Jump to content


This topic is now archived and is closed to further replies.


check for duplicate rows

Recommended Posts

I'm working on a page that selects id, alias, and ipaddress from table users and it then lists it to a webpage. I worked everything out and it post my table to the website and sorts by IP. Exactly how I want it to. The only problem is that im trying to get it to list DUPLICATE in the <td> beside the ip address so that I can see when viewing my user database wich accounts are duplicate ip's. I am farely new to php and I'm not sure what the value to X in my code should be or if i should use a different method. Any help would be great. Here is a snip from some of my code.

$getipinfo = mysql_query("SELECT * FROM users ORDER BY ipaddress ASC");
$ip=mysql_query("SELECT ipaddress from users");


if($ipaddress =="[color=red]x[/color]")){
$iconlist=$iconlist."<font color=#FF0000><b>DUPLICATE</b></font> ";

$userlist = $userlist."
<td bgcolor=202020>$id</td>
<td bgcolor=202020>$alias</td>
<td bgcolor=202020>$ipaddress</td>
<td bgcolor=202020>$iconlist</td>";
$userlist = $userlist

Share this post

Link to post
Share on other sites
What output do you get ? Can you paste the HTML you get in the View Source of the page ?

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.