Sunday, 30 July 2017

mysqli - PHP : Fatal error: Call to a member function fetch_assoc() on boolean

I have this code :



$sql = "SELECT * FROM trading 
WHERE order_status <> 'DELETE'
ORDER BY date DESC
LIMIT 2";
$result = $conn->query($sql);


while($row = $result->fetch_assoc()) { << LINE 96

if ($row["type"] == 'BUY') {
---- CODE CUT HERE ----


and it gives me this error message :



Fatal error: Call to a member function fetch_assoc() on boolean in /**/**.php on line 96



why this line 96 :



while($row = $result->fetch_assoc()) {


produce that error message?

No comments:

Post a Comment

casting - Why wasn&#39;t Tobey Maguire in The Amazing Spider-Man? - Movies &amp; TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...