Re: Bizarre SQl, if issue....

From: Date: Tue, 29 Jul 2003 17:46:40 +0000
Subject: Re: Bizarre SQl, if issue....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157350@lists.php.net to get a copy of this message
Hello, This is a reply to an e-mail that you wrote on Tue, 29 Jul 2003 at 18:25, lines prefixed by '>' were originally written by you. > If the SQL statement returns an empty set, shouldn't $result be equal > to 1? > Instead, I'm getting $result = 4. If the query fails, e.g. because you have an error in your SQL $person will contain FALSE. If the query executes succesfully (whether it is an empty set or not) $person could contain any number at all which represents the result resource. I think you want... $numrows = mysql_num_rows($person); if($numrows===0){ // result set was empty } HTH David -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP)

« previous php.general (#157350) next »