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 Link to comment https://forums.phpfreaks.com/topic/92838-simple-query-is-driving-me-mad/ 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. Link to comment https://forums.phpfreaks.com/topic/92838-simple-query-is-driving-me-mad/#findComment-475573 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... Link to comment https://forums.phpfreaks.com/topic/92838-simple-query-is-driving-me-mad/#findComment-475591 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); Link to comment https://forums.phpfreaks.com/topic/92838-simple-query-is-driving-me-mad/#findComment-475595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.