cturner Posted July 7, 2008 Share Posted July 7, 2008 I am wanting to display a title and description to match a group of photos. The result from my code displays this: Title1 Description1 Photo1 Title1 Description1 Photo2 Here is my code: require "config.php"; // more code here $sql = "SELECT * FROM `livestock_photos` WHERE parent_id = '".mysql_real_escape_string($row['id'])."'"; if($debug == TRUE) echo '<p>DEBUG3: '.$sql.'</p>'; $result2 = mysql_query($sql) or die ('Could not query because: ' . mysql_error()); while ($row2 = mysql_fetch_assoc($result2)) { echo '<strong>'.$row2['title'].'</strong><br />'; echo $row2['description']."<br />"; echo '<a href="javascript:void(0)" onClick="popWin(\''.$images_location_large.$row2['filename'].'.htm\', \'\', \''.$popup_width.'\', \''.$popup_height.'\')"><img src="'.$images_location.$row2['photos'].'" border="0" /></a> '; $parent_id = $row2['parent_id']; } // more code here mysql_close(); My table structure is: Livestock_photos photos_id // the auto-incremented number parent_id // is the livestock listing's number title description filename // displays like this: livestock photo photos // displays like this: livestock photo.jpg You will be able to see why I have used filename and photos in the database, by looking at my code above. A photos row only displays one thing not multiple things. Can someone please help me solve this problem asap? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
cturner Posted July 8, 2008 Author Share Posted July 8, 2008 Someone please I desperately need this done asap. Quote Link to comment Share on other sites More sharing options...
cturner Posted July 8, 2008 Author Share Posted July 8, 2008 Forget it. I have asked someone else to do it. 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.