Re: [PHP] mysql_trouble (check fast!)

2001-05-08 Thread James, Yz
Hi Fredrik, Always check whether or not the required variables are there BEFORE querying the database. And make sure that the negatives are dealt with first. That's my opinion. I'd probably also check whether the original username / password is in the database before proceeding. Probably m

RE: [PHP] mysql_trouble (check fast!)

2001-05-08 Thread Matt Schroebel
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 f

[PHP] mysql_trouble (check fast!)

2001-05-08 Thread FredrikAT
$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