Jump to content


Photo

check for duplicate rows


  • Please log in to reply
2 replies to this topic

#1 lJesterl

lJesterl
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts

Posted 01 September 2006 - 06:56 AM

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 =="x")){
$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

#2 lJesterl

lJesterl
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts

Posted 01 September 2006 - 01:11 PM

=[

#3 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 01 September 2006 - 01:20 PM

What output do you get ? Can you paste the HTML you get in the View Source of the page ?
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users