h1234 Posted September 30, 2013 Share Posted September 30, 2013 Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given its a login form here is my code thats producing the error .i need to test if user_is true. function login($username , $password){ GLOBAL $dbc; //database $user_id= user_id_from_username($username); $username = sanatize($username); $password = md5($password); $query= mysqli_query($dbc,"SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `password ` = '$password'"); $check= mysqli_fetch_array( $query , MYSQLI_BOTH); // even if i add this set of code the query still gives the above error. return ($check[0]==1)? $user_id : false; } Link to comment https://forums.phpfreaks.com/topic/282556-i-get-the-follow-error/ Share on other sites More sharing options...
mac_gyver Posted September 30, 2013 Share Posted September 30, 2013 you need to stop creating new threads for the same issue/code. taking out the mysqli_error() statement only means that the error moved down in the code. you need to go back to your first thread and solve what is wrong with the msyqli_error() statement so that it will then tell you why your query is failing. Link to comment https://forums.phpfreaks.com/topic/282556-i-get-the-follow-error/#findComment-1451832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.