Re: mysql and md5??

From: Date: Thu, 25 Mar 2004 02:10:08 +0000
Subject: Re: mysql and md5??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-181436@lists.php.net to get a copy of this message
Andy B wrote:
mysql_query("select * from rnjresort.users where username='$username' and pwd=md5($password)"); //see if user exists.. if(mysql_affected_rows()==0){
You're not assigning the query result to a variable. $result = mysql_query(" ... "); Then, mysql_affected_rows() is not going to return anything for a SELECT query. It's only for UPDATE/INSERT/DELETE queries. You need to use mysql_num_rows(). if(mysql_num_rows($result)==0){ -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#181436) next »