Jump to content

Data doesn't show up


ecabrera

Recommended Posts

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;

Link to comment
https://forums.phpfreaks.com/topic/295287-data-doesnt-show-up/
Share on other sites

$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;
Link to comment
https://forums.phpfreaks.com/topic/295287-data-doesnt-show-up/#findComment-1508217
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.