Database error php mysqli_fetch_array() expects Parameter 1 to be mysqli_result, bool Given in C: xampp htdocs delete.php on line 36

Asked

Viewed 10 times

0

i am making a database deletion code in php, and ta giving this error on line 36

require "conecta.php";

$flag=false;

$conecta= mysqli_connect("localhost","root","","cadastro");

$consulta = "SELECT * FROM cliente WHERE Codigo =" .$_POST['codigo'];

$resultado = mysqli_query($conecta,$consulta);

while ($registro = mysqli_fetch_array($resultado))

{

$var_cod= $registro['codigo'] ;

$var_nome= $registro['nome'] ;

$var_cidade= $registro['cidade'];

$flag=true;

The error is on this line here

while ($registro = mysqli_fetch_array($resultado))

I hope you can help me

  • Hello Felipe, the problem is probably the value passed in the POST, I recommend you read this: https://answall.com/q/3864/3635

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.