Re: Search for duplicate entries in database????
I created a little script to help get you on the way to solving your problem. I have a table with a column in it that lists a whole bunch of serial numbers, one serial number per row in my table. What you have to do is scroll down through your table ( I used a WHILE loop) and look at all the serial numbers for a match. When I find a match I create a message variable called $msg = "Found". After the WHILE loop ends I create an IF statement that says if my message variable says FOUND then echo the message Serial Number found else echo the message Serial Number Not Found. So here is how I did it:
$var = 999; //This is the serial number I want to find
while ($row = mysql_fetch_array($result)) { // Start WHile loop
$sn = $row['SN']; // SN is the column
if ($sn == $var) { // looking for a match
$msg = "Found"; // $msg = "Found" if there is a match
}
} // End of WHILE loop
if ($msg == "Found") {
echo "Serial Number Found"; // Echo Serial Number Found
} else {
echo "Serial Number Not Found"; // Echo Serial Number Not Found
}
I actually created a little table and used this script. You will obviously need to modify it for your particular case but it should give you some idea's as to what you need to do.
Good Luck!
Subject
Written By
Posted
December 20, 2005 05:10AM
December 20, 2005 05:54AM
Re: Search for duplicate entries in database????
December 22, 2005 09:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.