Fatal error: Non-static method mysqli::query() cannot be called statically in C:\wamp\www\CTE\consultaorganizada2.php on line 23
Miro la linea 23 y viendo el manual de PHP la he cambiado de mil maneras y no da. Adjunto el codigo y gracias por la colaboracion.
Código PHP:
<?php
$con = new mysqli("localhost", "andres","password", "cte");
if ($con-> connect_errno) {
echo "No se pudo conectar a Mysql(".$con->connect_errno.")". $con->connect_error;
}
echo $con->host_info ."\n";
$con = new mysqli("127.0.0.1", "andres","password","cte" );
if ($con-> connect_errno) {
echo "No se pudo conectar a Mysql:(".$con->connect_errno.")". $con->connect_error;
}
$sql = "SELECT * FROM clientes C INNER JOIN producto P ON C.serial = P.serial";
$myData = mysqli::query ($sql,$con);
echo "<table border=1>
<tr>
<th>Cliente</th>
<th>Cedula</th>
<th>Orden numero</th>
<th>Email</th>
<th>Barrio</th>
<th>Telefono</th>
<th>Producto</th>
<th>Marca</th>
<th>Almacen</th>
<th>Dano</th>
<th>Fecha de recepcion</th>
<th>Tecnico</th>
<th>Estado</th>
<th>Sede</th>
<th>Fecha de entrega</th>
</tr>";
while ($record = mysqli_result::fetch_array($myData)){
echo "<tr>";
echo "<td>" . $record['cliente'] . "</td>";
echo "<td>" . $record['cedula'] . "</td>";
echo "<td>" . $record['serial'] . "</td>";
echo "<td>" . $record['email'] . "</td>";
echo "<td>" . $record['barrio'] . "</td>";
echo "<td>" . $record['telefono'] . "</td>";
echo "<td>" . $record['producto'] . "</td>";
echo "<td>" . $record['marca'] . "</td>";
echo "<td>" . $record['almacen'] . "</td>";
echo "<td>" . $record['dano'] . "</td>";
echo "<td>" . $record['fecharecepcion'] . "</td>";
echo "<td>" . $record['tecnico'] . "</td>";
echo "<td>" . $record['estado'] . "</td>";
echo "<td>" . $record['sede'] . "</td>";
echo "<td>" . $record['entregaacliente'] . "</td>";
}
echo "</table>";
mysqli_close ($con);
?>
?>
</body>
</html>