rhyno Posted February 11, 2008 Share Posted February 11, 2008 I need to have the entire result set returned... However mysql_fetch_array() does not return all the row in the DB... ??? mysql_select_db($database_chry7248, $chry7248); $query_rsImages = "SELECT tblimages.filelocation, tblimages.`description`, tblimages.dogfk, tblimages.width, tblimages.height FROM tblimages, tbldogs WHERE tblimages.dogfk = tbldogs.dog_id AND tbldogs.dog_id = ".$_GET['dogID'].""; $rsImages = mysql_query($query_rsImages, $chry7248) or die(mysql_error()); $row_rsImages = mysql_fetch_assoc($rsImages); $totalRows_rsImages = mysql_num_rows($rsImages); is the first block of code called... then I have... while ($row = mysql_fetch_assoc($rsImages)) { echo '<div align="center"><img class="pic" src="'.$row['filelocation'].'" alt="'.$row['description'].'" width="'.$row['width'].'" height="'.$row['height'].'"/></div>'; } else where on the page... I know I am using different names in the two examples and that it is considered bad form. Can you help me out with this? Please... If it is in the wrong forum I apologize. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 11, 2008 Share Posted February 11, 2008 This statement <?php $row_rsImages = mysql_fetch_assoc($rsImages); ?> gets the first row then your loop gets the rest. Remove that line. Ken Quote Link to comment Share on other sites More sharing options...
revraz Posted February 11, 2008 Share Posted February 11, 2008 Echo $query_rsImages and you should see the problem. Quote Link to comment Share on other sites More sharing options...
rhyno Posted February 11, 2008 Author Share Posted February 11, 2008 Thanks for the quick reply Ken. You solved my problem... Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.