I'll start by explaining what I've got. Basically PHP calls the database (MySQL) and then put it into an html table.

It works fine apart from I want the ID number to be placed into the image path. eg. ID 1 would call 1.png ID 2 calls 2.png etc.

All i can manage to do is get the first letter of the Location's to be called.

Many thanks and any help is appreciated greatly
PS. I'm not the best at PHP

PHP Code:
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
$db_user 'jswscouk_snailad';
$db_pwd 'erik123';

$database 'jswscouk_snail';
$table 'snail';

if (!
"Can't connect to database");

if (!
"Can't select database");

// sending query
$result mysql_query("SELECT * FROM {$table}");
if (!
$result) {
"Query to show fields from table failed");

$fields_num mysql_num_fields($result);
/* printing table headers
for($i=0; $i<$fields_num; $i++)
    $field = mysql_fetch_field($result);
    echo "<thead><td>{$field->name}</td>";
echo "</tr>\n";
// printing table rows
while($row mysql_fetch_row($result))

// $row is array... foreach( .. ) puts every element
    // of $row to $cell variable
foreach($row as $cell)
"<td><img src='???????' height='42' width='42'></td>";
Run on bootstrap if that makes any difference?