That makes sense, sound like I'm redoing in PHP what the UNIQUE column
already does.
So all I need to do is modify my PHP trap using mysql_affected_rows() =
0, retun a error messagu to the used indicating a rcord already exists.
Will try it, THX!
Pete
Paul DuBois wrote:
>
> At 5:46 PM -0500 6/27
At 5:46 PM -0500 6/27/01, Pete Kuczynski wrote:
>Thanks Paul!
>ps works great!
>I modified the database with a UNIQUE column like you recommended
>earlier, this will now help in the PHP script to trap the duplicate
>entry and advise the user of the dup.
But if hostname now has a UNIQUE index on i
Thanks Paul!
ps works great!
I modified the database with a UNIQUE column like you recommended
earlier, this will now help in the PHP script to trap the duplicate
entry and advise the user of the dup.
1
$result = mysql_query($query);
// check if row is returned, if yes error, if
>Hi,
>How would a word a select statment, to search a database for duplicate
>entries in one field.
>
>For example, the fields: device, hostname, IP, comments
>
>I want to find all instances where there my be two devices with the same
>hostname.
>
>Thanks!
>
>Pete
Sir, try the following.
SELECT
Peter,
That comes pretty close to the distinct -thread in this mailinglist.
You might want to try:
SELECT device, count(hostname)
FROM your_table
GROUP BY device
HAVING count(hostname)>1;
This would display all devices with at least 2 (or more) hostnames.
If you always have the same IP address,
At 3:13 PM -0500 6/27/01, Pete Kuczynski wrote:
>Hi,
>How would a word a select statment, to search a database for duplicate
>entries in one field.
>
>For example, the fields: device, hostname, IP, comments
>
>I want to find all instances where there my be two devices with the same
>hostname.
SEL
Hi,
How would a word a select statment, to search a database for duplicate
entries in one field.
For example, the fields: device, hostname, IP, comments
I want to find all instances where there my be two devices with the same
hostname.
Thanks!
Pete
--
___
P