Need to Reverse the Order of images imported from DB
Posted: Wed Sep 08, 2010 7:35 pm
The code below brings images in from the database into a table, as you can see. I am desperately trying to have the import order reversed. I have tried a few things but to no avail, it may be that I was on the right track but my head is sore from banging it against the nearest wall.
Can anyone tell me how to do it? I am not new to php, but I am also not under the "advanced" category, so please.. speak to me like i am retarded
Love,
Tyler
Can anyone tell me how to do it? I am not new to php, but I am also not under the "advanced" category, so please.. speak to me like i am retarded
Code: Select all
<?php
include_once("db_connect.php");
$sql = "SELECT imageURL FROM commercial";
$result = mysql_query($sql);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$imageURL=mysql_result($result,$i,"imageURL");
//echo $imageURL.$i;
$i++;
echo '<td><a id="'.$i.'" name="'.$i.'"></a><a href="#'.$i.'"><img class="TipImg" src="'.$imageURL.'" alt="" title="" height="440" /></a></td>';
}
?>Tyler