我想显示数据库中的前10行


I want to show first 10 rows from the database

这是我用于此目的的代码

$sql_s="SELECT column FROM products LIMIT 10 WHERE id_product={$id}";

LIMIT 10应放在WHERE子句之后。

$sql_s = "SELECT column FROM products WHERE id_product={$id} LIMIT 0, 10";

编辑1

这个链接有助于调试MySQLi(假设您正在使用它)。

http://jason.pureconcepts.net/2013/04/common-debugging-php-mysql/