$consulta1="SELECT * FROM PRODUCTO LIMIT $empezarDesde,$contenidoPorPagina
WHERE FAMILIA BETWEEN 0 AND 5 ORDER BY FAMILIA ASC";
$resultado1 = $mysqli->query($consulta1);
while($dato = $resultado1->fetch_assoc()){
...
}
我正在做一个shopWeb,我的查询无效。
答案 0 :(得分:2)
LIMIT应该在查询的末尾......
$consulta1="SELECT * FROM PRODUCTO
WHERE FAMILIA BETWEEN 0 AND 5
ORDER BY FAMILIA ASC
LIMIT $empezarDesde,$contenidoPorPagina";