justinbriggs1 Posted April 25, 2010 Share Posted April 25, 2010 Hey everyone, I am trying to display the result set of an array that I got from mysql_fetch_array, like this: while($imageinfo_array = mysql_fetch_array( $imageinfo_query )) <?php echo $imageinfo_array['IMAGE_FILE'] ; ?><?php echo $imageinfo_array['CATEGORY_TYPE'] ; ?>etc.But there is sometimes more than one CATEGORY_TYPE associated with an IMAGE_FILE. I am just looking to print out the image file and then a list of the categories associated with them, without reprinting the image again.I'm pretty sure this is common, but I've been at a loss as to an easy way to do it. Thanks,JW Link to comment Share on other sites More sharing options...
jeffman Posted April 25, 2010 Share Posted April 25, 2010 How's your table structured? You don't have multiple columns named CATEGORY_TYPE, right? How are the different types delimited? Link to comment Share on other sites More sharing options...
justinbriggs1 Posted April 25, 2010 Author Share Posted April 25, 2010 How's your table structured? You don't have multiple columns named CATEGORY_TYPE, right? How are the different types delimited?Sure, the table array result is structured like this:CATEGORY_TYPE--------IMAGE_FILE Buildings------------------church.jpg Buildings------------------city.jpg Objects--------------------clock.jpg Machinery-----------------clock.jpg I just want to have it display like this:IMAGE------------CATEGORYchurch.jpg-------Buildingscity.jpg-----------Buildingsclock.jpg---------Objects, MachinerySorry about the dashes, they are there to separate the columns. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.