mysql查询不好我需要帮助才能从我的数据库中显示我的产品

时间:2018-06-17 20:11:09

标签: php mysql phpmyadmin

    $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,我的查询无效。

1 个答案:

答案 0 :(得分:2)

LIMIT应该在查询的末尾......

$consulta1="SELECT * FROM PRODUCTO  
             WHERE FAMILIA BETWEEN 0 AND 5 
             ORDER BY FAMILIA ASC
             LIMIT $empezarDesde,$contenidoPorPagina";