Germaris Posted February 25, 2008 Share Posted February 25, 2008 Hi there! In my script I use the following code: $table = "_lisausers"; $mypassword; //this is a 'POST' variable $query =mysql_query("SELECT pwd FROM `$table` WHERE pwd LIKE '$mypassword'" ) or die(); if (mysql_num_rows( $query ) > 0) { print "&retour=true"; } else { print "&retour=false"; } Despite the fact that $mypassword already exists in the $table, this query always gives me a wrong result if I ask an existing or not pwd in this table !!! Would you tell me what's wrong in this query and the if/else block? Many thanks in advance for your help! Regards, Gerry Quote Link to comment Share on other sites More sharing options...
trq Posted February 25, 2008 Share Posted February 25, 2008 Replace.... or die(); with... or die(mysql_error()); and see if thats gives you any clues. Quote Link to comment Share on other sites More sharing options...
Germaris Posted February 25, 2008 Author Share Posted February 25, 2008 Thanks for replying! No, it doesn't change anything... Quote Link to comment Share on other sites More sharing options...
Steve Angelis Posted February 25, 2008 Share Posted February 25, 2008 Try this: $query =mysql_query("SELECT pwd FROM `$table` WHERE pwd='$mypassword'" ) or die("Quesry does not make sence: ".mysql_error); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.