Expand|Select|Wrap|Line Numbers
- $email = sterile($_POST['email']);
- $zip = sterile($_POST['zip']);
- $sql = mysql_query("SELECT * FROM users WHERE email='$email'");
- if(is_bool($sql)){
- die("BOOL");
- }
- while($row = mysql_fetch_assoc($sql)){
- // reset password, etc
- }
I get this error from time to time, and still don't quite understand it. Typically, I spend around half an hour changing my query string until I have it back to how it was originally, then it magically starts working.
From reading up on it, I've gathered that this error generally occurs when the query returns a boolean result, or no result at all. (Hence the is_bool test code).
The curious part about this is.. despite the error, it still successfully queries the database, generates a random password, updates it in the database, and sends an email to the stored address.
Any thoughts??
Thanks!