I have this code that populates a dynamic table data
PHP Code:
mysql_connect("localhost", "taverna", "taverna") or die(mysql_error()); mysql_select_db("taverna") or die(mysql_error());
// SQL query to interact with info from our database $sql = mysql_query("SELECT gal_id, pic_name FROM galeria ORDER BY gal_id DESC LIMIT 100"); $i = 0; // Establish the output variable $dyn_table = '<table border="1" cellpadding="0">'; while($row = mysql_fetch_array($sql)){
$gal_id = $row["gal_id"]; $pic_name = $row["pic_name"]; //<img src='fiestaspic/$row[pic_name]' if ($i % 3 == 0) { // if $i is divisible by our target number (in this case "3") $dyn_table .= '<tr><td>' .$pic_name.'</td>'; } else { $dyn_table .= '<td>' . $pic_name . '</td>'; } $i++; } $dyn_table .= '</tr></table>'; ?>
PHP Code:
<?php echo $dyn_table; ?>
However i want to populate a image,,, but for some reason onlygive the name of the picture not the image.... can you guys help me please thank you