Question:
Date: 06-06-2019 06:59:03
(In Spanish)
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in
Error cuando voy a realizar un inner join: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result[Resolved]
Buenas, tengo el siguiente código, cuando lo ejecuto.... me sale el siguiente error y no lo he podido arreglar... quien me ayudaWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in
<?php
$conexion=mysqli_connect('localhost','root','','pms24_db');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="css/estilos.css">
<title>INVENTARIO</title>
<body background="img/fondook.png">
<script scr="js/main1.js"></script>
<script type="text/javascript"></script>
</head>
<header class="header2">
<img src="img/logo_marcazeta.png">
<center>
<h1 class="titulo1">INVENTARIO MARCAZETA LINEA</h1>
<table class="table" id="mitabla">
<thead class="titulo">
<tr>
<th>CLIENTE</th>
<th>REFERENCIA</th>
<th>DESCRIPCION</td>
<th>MODELO</th>
<th>CANTIDAD</th>
<th>PRECIO</th>
</tr>
</thead>
</header>
<?php
//$sql="SELECT * FROM mzt_reference";
//$result=mysqli_query($conexion,$sql);
$query="SELECT r.reference, r.description, r.modelo , r.modelo, r.precio, c.client_id FROM mzt_reference r INNER JOIN mzt_client c ON r.client_id=c.client_id";
//$consulta=$conexion mysqli_query($conexion,$sql);
$consulta=$conexion->query($query);
while ($mostrar=mysqli_fetch_array($query))
{
echo'
<tr>
<td style="font-size: 19px">'.$mostrar['reference'].'</td>
<td style="font-size: 19px">'.$mostrar['description'].'</td>
<td style="font-size: 19px">'.$mostrar['modelo'].'</td>
<td style="font-size: 19px">'.$mostrar['modelo'].'</td>
<td style="font-size: 19px">'.$mostrar['precio'].'</td>
<td style="font-size: 19px">'.$mostrar['name'].'></td>
</tr>
';
}
?>
</table>
</center>
</body>
</html>.
Votes: 0 -
Answers: 2 -
Views: 12
Share on: Google
Facebook
Twitter
LinkedIn
Link
Answers:
-
Date: 06-06-2019 07:20:18 Verifica bien esas dos lineas...
$consulta=$conexion->query($query); while ($mostrar=mysqli_fetch_array($query))
Saludos....
Stryfe™ Votes: 0 - Link answer -
Date: 09-06-2019 14:23:55 La línea que dice
while ($mostrar=mysqli_fetch_array($query))
debe ser
while ($mostrar=mysqli_fetch_array($consulta))
Votes: 2 - Link answer
To actively participate in the community first must authenticate, enter the system.Sign In
