Re: If (!$results) are true what am I missing

From: Date: Tue, 10 Jul 2001 05:32:09 +0000
Subject: Re: If (!$results) are true what am I missing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57073@lists.php.net to get a copy of this message
um...I believe your query will return results if there is a match, but your error message will only display if there is no match. !$result will only be true if there are no records returned on your query, meaning that the domain name doesn't exist. From your error message, I'd say that's not what you're looking for. --kurt ----- Original Message ----- From: "Richard Kurth" <rkurth@pacifier.com> To: "php" <php-general@lists.php.net> Sent: Monday, July 09, 2001 10:07 PM Subject: [PHP] If (!$results) are true what am I missing > What am I missing hear all I what to do is see if the domaname is > in the database and if it does print the error message if does not then > just move on without doing anything > > > $db = MYSQL_CONNECT($roothostname,$rootusername, $rootpassword) OR DIE("Unable to connect to database"); > mysql_select_db($dbName, $db); > $result = mysql_query( "SELECT * FROM customers WHERE domaname = $domain1", $db); > If (!$result) { > print_error("<b> This Domain Name $domain1 already exist please select a new Domain Name </b> "); > } > > > > > > > > > > > > Best regards, > Richard > mailto:rkurth@pacifier.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#57073) next »