justinbriggs1 Posted November 22, 2008 Share Posted November 22, 2008 I can't seem to figure out why I keep getting a "query was empty" error, probably overlooking something, maybe someone can help me out Thanks:if (!(@mysql_select_db("fff",$connection))) $query = "SELECT * FROM cbsettings WHERE admin_email = '$admin_email' AND password = '$passwordhash'"; $result = mysql_query($query, $connection) or die ("Error in query:". $query . mysql_error()); // if row exists -> user/pass combination is correct if (mysql_num_rows($result) == 1) { return 1; } // user/pass combination is wrong else { return 0; } Link to comment Share on other sites More sharing options...
jeffman Posted November 22, 2008 Share Posted November 22, 2008 if (!(@mysql_select_db("fff",$connection))) $query = "SELECT * FROM cbsettings WHERE admin_email = '$admin_email' AND password = '$passwordhash'";If this quote is accurate, then $query only has a value if you FAIL to select a DB. Maybe there's supposed to be an exit routine after the conditional? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.