+ 1
Why does it now work.
<?php function result ($resolution) { while ( ( $qator = $resolution->fetch_assoc()) === true) { print_r ($qator); echo "<br>"; } } $mysqli = new mysqli("localhost", "root", "12182001", "my_base") or die("Connection error"); $mysqli->query ("SET NAMES 'utf8'"); $resolution = $mysqli->query ("SELECT * FROM 'user'"); result ($resolution); $mysqli->close (); ?> error ------------------------------- Call to a member function fetch_assoc() on boolean in C:\wamp64\www\test\testing.php on line 3 -------------------------------
2 Answers
+ 5
fetch_assoc() fetch the value from the database table. There is no need to check at that point whether the value is present or not, plus, the === operator is inappropriate because it checks whether the data inside table is available as well as true (boolean).
+ 1
what do you see? what is the error?