brob Posted February 5, 2007 Share Posted February 5, 2007 I'm pulling a query from a database and want to check to see if there are any duplicates. I don't want to remove the duplicates but display the id of them. Does anyone know how to do this? Thanks Link to comment https://forums.phpfreaks.com/topic/37143-match-two-entires-from-a-query-result/ Share on other sites More sharing options...
Balmung-San Posted February 5, 2007 Share Posted February 5, 2007 Well, to check for duplicates I'd use mysql_num_rows. As for displaying the id, a loop through them is the only method I know about. <?php //connect... //query if(mysql_num_rows($result) > 1) { //display ids while($data = mysql_fetch_array($result)) { echo $data['id']; } } else { } ?> Link to comment https://forums.phpfreaks.com/topic/37143-match-two-entires-from-a-query-result/#findComment-177361 Share on other sites More sharing options...
phat_hip_prog Posted February 5, 2007 Share Posted February 5, 2007 Here's a little ref, look at the replies: http://uk2.php.net/manual/en/function.array-unique.php Link to comment https://forums.phpfreaks.com/topic/37143-match-two-entires-from-a-query-result/#findComment-177365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.