Jump to content

check for duplicate rows


lJesterl

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");
while(list($id,$alias,$pass,$email,$icq,$aim,$yahoo,$website,$logo,$newsletter,$joindate,$ipaddress)=mysql_fetch_row($getipinfo)){
$ip=mysql_query("SELECT ipaddress from users");

$iconlist="";

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

$userlist = $userlist."
<tr>
<td bgcolor=202020>$id</td>
<td bgcolor=202020>$alias</td>
<td bgcolor=202020>$ipaddress</td>
<td bgcolor=202020>$iconlist</td>";
$userlist = $userlist
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.