I'm creating a form counter and would like to know if I'm going the right way?
This is my select query
<?php
error_reporting(-1);
ini_set('display_errors', 'On');
//Criar a conexao
$link = new mysqli ("localhost", "root", "", "peixaria");
if($link->connect_errno){
echo"Nossas falhas local experiência ..";
exit();
}
$sql= "SELECT MAX(m.id_pedido)
FROM mpedido as m WHERE id_pedido
ORDER BY m.id_pedido DESC
LIMIT 1";
$resultado_id= mysqli_query($link,$sql);
?>
and this is the php code that displays the id as counter. but type is giving an error
Notice: Array to string conversion in C: \ xampp \ htdocs \ Projects \ order.php on line 61
<span>Comanda:</span>
<?php
while($row = mysqli_fetch_array($resultado_id)){
echo '<span>'.["id_pedido"].'</span>';
}
?>
How could I make a counter from the id