$results = mysql_query(\"select * from classpics\");
foreach($results as $uno) {
echo \'
-
mysql_query
returns resource, not an array or any other container. Use mysql_fetch_assoc() to fetch the next result.
while ($uno = mysql_fetch_assoc($result)) {
echo '<td valign="middle" align="center"><a class="neutral" href="../images.php?id=' . $uno['id'] . '"><img src="'. $uno['thumbs'].'" border="0" /></a>';
}
讨论(0)
-
The mysql_query
returns a resource id, you should fetch an array:
$results = mysql_query("select * from classpics");
while($row = mysql_fetch_array($results)){
echo '<td valign="middle" align="center"><a class="neutral" href="../images.php?id=' . $row['id'] . '"><img src="'. $row['thumbs'].'" border="0" /></a>';
}
讨论(0)
-
you should fetch data from result
while($data=mysql_fetch_array($results)) {
echo '<td valign="middle" align="center"><a class="neutral" href="../images.php?id=' . $uno['id'] . '"><img src="'. $uno['thumbs'].'" border="0" /></a>';
}
讨论(0)
- 热议问题