1
I have following code I’m learning:
$mysqli = new mysqli('localhost', 'root', '', 'mydb');
$sql = "SELECT * FROM ordem_producao WHERE op_id = $id;";
$query = $mysqli->query($sql);
$resultado = $query->fetch_assoc($sql);
in the body
of my html I have:
<?php echo $resultado['id']; ?>
on the page appears following error
PHP Warning: mysqli_result::fetch_assoc() expects Exactly 0 Parameters, 1 Given in E: home pages view view_op.php on line 9
line 9 is the code
$resultado = $query->fetch_assoc($sql);
What am I doing wrong??
Thank you
None of the answers were helpful?
– Marcelo de Andrade