steelmanronald06 Posted June 28, 2007 Share Posted June 28, 2007 Okay, this is kind of weird. It says there is a problem with my query, but it doesn't display the error message. Here is my code: $username = htmlentities(mysql_real_escape_string($username)); $password = htmlentities(mysql_real_escape_string($password)); // Encrypt the password $dbpassword = md5($password); // Validate the user $validateQuery = mysql_query("SELECT * FROM `users` WHERE `username`='$username' AND `password`='$dbpassword' AND `activated`='1' LIMIT 1"); if (!$validateQuery) { echo 'Error executing query:' . $db->ErrorMsg() . "<br />"; echo $username . "<br />"; echo $password . "<br />"; echo $dbpassword . "<br />"; die(); } and here is the output Error executing query: rlsteelman mypassword md5_of_my_password Now, why is it saying Error executing query: but not displaying any error after it? $db->ErrorMsg(); should display the error, but it isn't. Any ideas? Quote Link to comment Share on other sites More sharing options...
per1os Posted June 28, 2007 Share Posted June 28, 2007 $sql = "SELECT * FROM `users` WHERE `username`='$username' AND `password`='$dbpassword' AND `activated`='1' LIMIT 1"; $validateQuery = mysql_query($sql); if (!$validateQuery) { echo 'Error executing query:' . $db->ErrorMsg() . "<br />"; echo $username . "<br />"; echo $password . "<br />"; echo $dbpassword . "<br />"; echo $validateQuery . "<br />"; // try this see if it prints out a resource. echo mysql_error() . "<br />"; // try this just for good measure. echo $sql . "<br />"; // try this just for good measure. die(); } report back what comes of it and we will go from there. Edit: added the $sql to the debug statements. Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted June 28, 2007 Author Share Posted June 28, 2007 genius! It told me that i had misnamed my column...now what i don't get is why didn't adodb's errormsg() function catch that??? Quote Link to comment Share on other sites More sharing options...
per1os Posted June 28, 2007 Share Posted June 28, 2007 Sorry if I am being newbish, but could you post the class definition of $db, and maybe I could help you figure out your second question. Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted June 28, 2007 Author Share Posted June 28, 2007 umm..dunno where the $db class definition lies. It is 3rd-party software: http://adodb.sourceforge.net 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.