Hello,
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">
    <thead>
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Location</th>
            <th>Image</th>
            
        </tr>
    </thead>
    <tbody>
<?php
$db_host 
'jsws.co.uk';
$db_user 'jswscouk_snailad';
$db_pwd 'erik123';

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

if (!
mysql_connect($db_host$db_user$db_pwd))
    die(
"Can't connect to database");

if (!
mysql_select_db($database))
    die(
"Can't select database");

// sending query
$result mysql_query("SELECT * FROM {$table}");
if (!
$result) {
    die(
"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))
{
    echo 
"<tr>";

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