我编写了以下内容,以通过我的 URL 中的 ?limit=10 限制我的表输出,但是它给了我:
( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\sql_table.php on line 44
Call Stack
# Time Memory Function Location
1 0.0005 250584 {main}( ) ..\sql_table.php:0
2 0.0020 258904 mysql_fetch_array ( ) ..\sql_table.php:44
我的代码如下:
if ($_GET['limit']) {
$limitsql = ' limit 0, ' . $_GET['limit'];
} else
$limitsql = '';
// This chooses which results i want to select from
$result = mysql_query("SELECT * FROM test1 WHERE 1" . '$limitsql');