Closed Chriswilldo closed 10 years ago
Line 7: $data = mysqli_fetch_assoc($r); return $data['value']; }
i have the same problem but i can't solve it
there was a wrong spelling in my SELECT statement when i solve this everything works OK check yours is all your spelling in database and function the same i hope i can help because my English not good
$data = mysqli_fetch_assoc($conn, $r);
return $data['value']; }
@poojakhatri the function mysqli_fetch_assoc()
only needs one parameter to be given, which needs to be the result of mysqli_query()
, mysqli_store_result()
or mysqli_use_result()
. If you give multiple values to mysqli_fetch_assoc()
it will output an error.
To fix your error just replace $data = mysqli_fetch_assoc($conn, $r);
by $data = mysqli_fetch_assoc($r);
For more information check the PHP manual, link here.
There is also this guy who commented a week ago having the very same issue; not me.
hsia yvonne 1 week ago
I have got the problem as this; Waring: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\sampp\htdocs\series\dynamic\AtomCMS\functions\data.php on line $data = mysqli_fetch_assoc($r); the icon has shown in the setup.php, but not in data.php
Any ideas? For some reason it's saying that my $data = mysqli_fetch_assoc($r); should have a mysqli result boolean given. I'm not entirely sure on what that means... Without this fix, I can't use my debug button :|. I've continued to part 21 thinking the solution would resolve itself but still nothing.. I'd really like a solution to this if available because I really am stuck at this point.
Here's my data.php so far.
<?php
function data_setting_value($dbc, $id) {
$data = mysqli_fetch_assoc($r);
return $data['value']; }
$q = "SELECT * FROM pages WHERE id = $id"; $r = mysqli_query($dbc, $q);
?>