I have to use a php function to manage some data from a db, but i get a Fatal Error on the line where I call mysqli_fetch_array().
$request = "SELECT Post.* FROM Post WHERE IdUseFk = '".$user_idPk."';";
$result = mysqli_query($CONN, $request)
or die ("<font color='red'>Error: ".mysqli_error($CONN)."</font>");
$num = mysqli_num_rows($result);
if ($num == 0) {echo "NOTHING TO DO HERE";}
else
{
for ($i=1; $i<=$num; $i++)
{
$row = mysqli_fetch_array($result, MYSQLI_ASSOC); //<<-- ERROR ON THIS LINE
/*...Some other code...*/
}
}
I get this: Fatal error: in C:\xampp\htdocs\Work\load_data.php on line 137
Any suggestion?
EDIT: PROBLEM SOLVED
I can't believe it. For some reason the 'space' chars I put before and after the '=' char in $row = mysqli_fetch_array()
weren't real spaces but another special char that is blank in most editors but php read as part of the function name. I was able to see it thanks to the editor in cpanel. Now it works