Why doesn't this piece of php code work?
- by Sam Gabriel
Hey guys, I have a mysql database which stores an id for each picture, as well as the picture's url and its thumbnail url. the thumbnail url is something like thumbs/pic.jpg and the page I'm creating has the folder thumbs in the same place it is created. But when I run this piece of code, nothing shows up:
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
mysql_connect("localhost", "***", "***") or die(mysql_error());
mysql_select_db("pics") or die(mysql_error());
$results = mysql_query("select id from classpics") or die(mysql_error());
$data=mysql_fetch_array($results);
foreach($data as $uno) {
echo '<td valign="middle" align="center"><a class="neutral" href="../images.php?id=' . $uno['id'] . '"><img src="'. $uno['thumbs'].'" border="0" /></a></td>';
}
?>