RE: [PHP] mysql_trouble (check fast!)
| From: | Matt Schroebel | Date: | Tue, 08 May 2001 20:18:24 +0000 |
| Subject: | RE: [PHP] mysql_trouble (check fast!) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51975@lists.php.net to get a copy of this message | ||
You have to check for a db result with either $count = mysql_num_rows($q_updateresult) or
if ($row = mysql_fetch_array($q_updateresult)).
mysql_query returns a 1 or 0 to indicate if the query was sucessful. One might typically query a db
before inserting a record to make sure it's not there first. If it's not there, there
wouldn't be a result, but the query was okay.
> From: FredrikAT [mailto:ftakle@online.no]
> $na_pw is the active password...
> ..if pw is blank or wrong i want to output a error message...
> ...iknow that I could do if (empty($na_pw) and $na_pw <>
> $pw), but then I
> would have to send another query to MySQL..
>
> I thought that q_updateresult would say (when i echo) 0 when
> password is bad, but it echos 1.