RE: RE: [PHP-WIN] duplicate entries
| From: | (Pete K.) | Date: | Tue, 24 Jul 2001 14:50:50 +0000 |
| Subject: | RE: RE: [PHP-WIN] duplicate entries | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-8479@lists.php.net to get a copy of this message | ||
That did it!
Much thanks!!!
Pete
"Michael Rudel" <mru@suchtreffer.de> wrote:
>SELECT * FROM asset WHERE hostname ='$hostname' and hostname != '';
>
>Greetinx,
> Mike
>
>Michael Rudel
>- Web-Development, Systemadministration -
>
>Besuchen Sie uns am 20. und 21. August 2001 auf der
>online-marketing-düsseldorf in Halle 1 Stand E 16
>_______________________________________________________________
>
>Suchtreffer AG
>Bleicherstraße 20
>D-78467 Konstanz
>Germany
>fon: +49-(0)7531-89207-17
>fax: +49-(0)7531-89207-13
>e-mail: mailto:mru@suchtreffer.de
>internet: http://www.suchtreffer.de
>_______________________________________________________________
>
>
>
>> -----Original Message-----
>> From: Pete K. [mailto:pkuczyns@netscape.net]
>> Sent: Tuesday, July 24, 2001 4:29 PM
>> To: php-windows@lists.php.net
>> Subject: [PHP-WIN] duplicate entries
>>
>>
>> Maybe someone can help.
>> this script catches all duplicate entries, in the hostname field of my
>> database. The problem is, if the hostname field is left
>> blank, [not all
>> devices have a DNS name], the script sees the blank field, and thinks
>> it's a duplicate.
>>
>> How can I reword it, so it prevents typed hostnames [like it does now]
>> but allows blank hostnames.
>>
>> Thanks in advance!
>> Pete
>>
>>
>>
>> /*Chck for another item with the same hostname */
>>
>> $result = mysql_query ("SELECT * FROM asset
>> WHERE hostname ='$hostname'
>> ");
>>
>>
>> // check if row is returned, if yes error, if no insert
>>
>> if (mysql_num_rows($result) != 0)
>>
>> {
>> echo "I'm sorry, I can't do that. A duplicate
>> hostname was found.";
>>
>> }
>>
>> else {
>> // DO INSERT
>> --
>> _______________________________________
>> Pete Kuczynski
>> Sr. Field Engineer
>> DHL Airways Inc.
>> Infrastructure Technology & Services
>> (773)-462-9758
>> 24/7 Helpdesk 1-800-434-5767
>>
>>
>> __________________________________________________________________
>> Your favorite stores, helpful shopping tools and great gift
>> ideas. Experience the convenience of buying online with
>> Shop@Netscape! http://shopnow.netscape.com/
>>
>> Get your own FREE, personal Netscape Mail account today at
>http://webmail.netscape.com/
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of
buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/