I am asking the question again, with more information and data. So you can understand me better:
"I edit the question again.
I want to show, the orders to each client: Reading from the mysql.
I have the record as follows:
Validation of the user charge
<?php
session_start();
if(!isset($_SESSION['cargo']) || $_SESSION['cargo'] != 2){
header('index.php');
$idusuario = $_SESSION['id']
}
?>
Table structure:
<?php
require('conexion.php');
$query="SELECT * FROM historial WHERE id = '$idusuario' ORDER BY fecha DESC;";
$resultado=$mysqli->query($query);
?>
<table id="orders" cellspacing="0" class="orders">
<thead>
<tr class="centro">
<th >Order</th>
<th >Fecha</th>
<th >Cliente</th>>
<th >Referencia</th>
<th >Familia</th>
<th >Ojo Derecho</th>
<th >Ojo Izquierdo</th>
</tr>
<tbody>
<?php
while($row=$resultado->fetch_assoc()){ ?>
<tr>
<td><?php echo $row['ordern'];?>
</td>
<td>
<?php echo $row['fecha'];?>
</td>
<td>
<?php echo $row['cliente'];?>
</td>
<td>
<?php echo $row['referencia'];?>
</td>
<td>
<?php echo $row['familia'];?>
</td>
<td>
<?php echo $row['od'];?>
</td>
<td>
<?php echo $row['oi'];?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
while($row=$resultado->fetch_assoc()){ ?>
"Call to a member function fetch_assoc ()"
I have tried several things according to the answers, but I get an error. I can not get to show me the client's. "