Re: mysql and md5??

From: Date: Thu, 25 Mar 2004 14:49:05 +0000
Subject: Re: mysql and md5??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-181493@lists.php.net to get a copy of this message
On Wed, 24 Mar 2004 20:46:33 -0500, aborka1@wmis.net (Andy B) wrote: >hi... > >trying to figure out what is wrong here... the code is supposed to check an md5'd password >from a form and compare it against an md5'd password in a mysql table... for some strange >reason when i run the code below on my dev server (apache 2.0.47, php4.3.3 and mysql 4.1-A) it >works. when i run it on the live site (apache 1.0.3.2, php 4.1.2 and mysql 3.22.5.6) it wont work >and for that matter wont even return an error! >mysql_query("select * from rnjresort.users where username='$username' and >pwd=md5($password)"); Try to put md5($password) inside single quotes, like this mysql_query("select * from rnjresort.users where username='$username' and pwd='".md5($password)."'"); or maybe $crypted_pass = md5($password); mysql_query("select * from rnjresort.users where username='$username' and pwd='$crypted_pass'");

« previous php.general (#181493) next »