Hi all,
This should be a simple issue to fix, Im trying to pull all rows from a table which contain image addresses. These go into a js sort of banner.
The issue im having is when I run the page only the last row of the db table is being called. Ive tried loops to no success and if I use my_sql_fetch_assoc only the first row is returned.
Can someone show me where im going wrong? heres the code
The problem im having is with $leftphoto, which is being used hereCode:<?php $sql="SELECT b.message, r.rightphoto, l.leftphoto FROM blog b, rightphoto r, leftphoto l"; $result=mysql_query($sql) or die (mysql_error()); while($r=mysql_fetch_array($result)){ $num=mysql_numrows($result); $message=$r["message"]; $rightphoto=$r["rightphoto"]; $leftphoto=$r["leftphoto"]; } ?>
I cant seem to get past this issue, having a total brain fart.Code:<?php echo"<li> <img src='leftphoto/$leftphoto'></li>"; //$i++; ?> </ul>
Any help would be greatly appreciated!
Thanks in advance!


Reply With Quote
Bookmarks