ecabrera Posted March 16, 2015 Share Posted March 16, 2015 I don't understand why this isn't showing up. I get this mysqli_fetch_assoc() expects parameter 1 to be mysqli_result but don't understand include "db.php"; $get = "SELECT * FROM `users`"; $getquery = mysqli_query($db,$get); $rows = mysqli_fetch_assoc($getquery); $id = $rows['id']; $dbemail = $rows['email']; $last = $rows['last']; echo $dbemail; Quote Link to comment Share on other sites More sharing options...
Barand Posted March 16, 2015 Share Posted March 16, 2015 See what the error message is with echo $db->error; Quote Link to comment Share on other sites More sharing options...
ecabrera Posted March 16, 2015 Author Share Posted March 16, 2015 The database is fine nothing is wrong with. I did echo $db->error; and nothing appears the only thing that appears is in my error log mysqli_fetch_assoc() expects parameter 1 to be mysqli_result Quote Link to comment Share on other sites More sharing options...
Solution Barand Posted March 16, 2015 Solution Share Posted March 16, 2015 $getquery will either be a mysqli result or, if the query failed, it will be "false". As you get a message saying it is not a result then the query failed and there should be an error message $get = "SELECT * FROM `users`"; $getquery = mysqli_query($db,$get); if (!$getquery) echo $db->error; 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.