0
I’m trying to use mysqli_fetch() to turn my mysql result into an array but php returns me the following message: Fatal error: Call to Undefined Function mysqli_fetch()
this is the function I’m using
public function PopulaPerfil()
{
include("conexao.php");
$cd = $_SESSION['cd_usuario'];
$query ="SELECT * FROM tb_usuario WHERE cd_usuario = '$cd' ";
$result = mysqli_query($conexao,$query);
$resultArray= mysqli_fetch($result);
return $resultArray;
die();
}
See in your php.ini if mysqli is enabled
– Joao Paulo
I’m sorry but I don’t understand what you mean by php.ini
– Reignomo
php.ini is a PHP configuration file. It is in the PHP directories of your pc. In it vc enables and disables modules and extensions and apparently your mysqli module is disabled (line should be commented).
– Joao Paulo
@Reignomo Tries to replace the function
mysqli_fetch
formysqli_fetch_all
ormysqli_fetch_array
– Piupz
Depending on the version of your php and the modules installed Voce can also get this error.
– Joao Paulo
@Joaopaulo @Reignomo The function
mysqli_fetch
is deprecated since version 5.4 of PHP– Piupz
Personal vlw switched to mysqli_fetch_array and worked :D
– Reignomo
Good @Piupz, I didn’t know. I haven’t touched php for years rs. Post as reply to the friend to give as conclusion!
– Joao Paulo