PHP show values of associative array when one of the values equals a specified value

I have a Mysql Recordset that I have put into an associative array so that I can reuse it over and over.I used this function to put the values into the array:\[code\]while(($Comments[] = mysql_fetch_assoc($rsComments)) || array_pop($Comments));\[/code\]Here is what the print_r($Comments) displays\[code\]Array ( [0] => Array ( [CommentID] => 10 [Comment] => Ouch [CommentAuthor] => Randy Krohn [CommentDate] => 2010-10-06 17:19:49 [ID] => 1231 [CategoryID] => 42 ) [1] => Array ( [CommentID] => 12 [Comment] => This is the Dirty Duck [CommentAuthor] => John Lemoine [CommentDate] => 2010-10-06 17:22:43 [ID] => 1411 [CategoryID] => 42 ) [2] => Array ( [CommentID] => 13 [Comment] => Talk about deja vu! [CommentAuthor] => dber [CommentDate] => 2010-10-06 17:24:48 [ID] => 1473 [CategoryID] => 42 ) )\[/code\]I am looping through a list of images, and I want to display only the comments associated with an images specified ImageID (for example 1473).I need to display only the ones where the ID is equal to a specified value?This must be easy, but for some reason, it is just flying over my head.Thanks for you help!
 
Back
Top