todo esta dentro del mismo fichero select.php
me devuelve 2 errores de php
ya he solucionado el problema hay alguna forma de hacer lo mismo pero sin la necesidad de utilizar
Código HTML:
Ver original<input type="submit" name="enviar" value="Aceptar información">
buscar dentro del select sin la necesida de cada vez que buscas una nueva categoria tener que seleccionar el input, desde el propio select hacer el submit
Código PHP:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /var/www/html/php/carpeta sin título/select.php on line 33
Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /var/www/html/php/carpeta sin título/select.php on line 41
Código HTML:
<html>
<body>
<form id="formulario" method="get" action="select.php">
<label for="id_categoria">Categoria</label> <br/>
<select id="id_categoria" name="id_categoria">
<optgroup label="Categoria">
<option value="00" selected="selected">a</option>
<option value="01">b</option>
<option value="02">c</option>
<option value="03">d</option>
<option value="04">e</option>
<option value="05">f</option>
<option value="06">g</option>
<option value="07">h</option>
</optgroup>
</select>
<input type="submit" name="enviar" value="Aceptar informació">
</form>
Código PHP:
<?php
$id_categoria=$_GET['id_categoria'];
include('select/select.php');
$link = mysqli_connect($hostname,$user,$password,$database);
$query = "select nombre_categoria,nombre_producto,ruta_foto_grande,ruta_foto_pequeña,descripcion_producto from producto,foto,categoria where id_foto=producto_id_foto and id_categoria=producto_id_categoria and id_categoria=$_GET[id_categoria] group by nombre_producto ";
$result = mysqli_query($link,$query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo $row['nombre_categoria'];
echo $row['nombre_producto'];
echo $row['ruta_foto_grande'];
echo $row['ruta_foto_pequena'];
echo $row['descripcion_producte'];
}
/* free result set */
mysqli_free_result($result);
/* close connection */
mysqli_close($link);
?>
Código HTML:
</body>
</html>