設置分頁,$result1
從表中提取所有行,$new_result
設置其限制。 但我得到了一個錯誤「致命錯誤:調用一個成員function fetch_assoc()
非對象/home/
....上」從mysqli獲取數據的致命錯誤,限制爲
$page_limit = 28;
$table_name_3 = 'table';
if (!isset($_GET['page']))
{ $start=0; } else
{ $start = ($_GET['page'] - 1) * $page_limit; }
$mysqli = new mysqli("xxxxxxx" , "xxxxxxx" , "xxxxxxx" , "xxxxxxxxx");
$result1 = $mysqli->query("SELECT * FROM $table_name_3
WHERE `categories` LIKE '$newq'
AND `inStock` LIKE 'true' ");
while ($rows = $result1->fetch_assoc()) {
$new_result = $mysqli->query($rows . "LIMIT $start,$page_limit ");
while ($rows = $new_result->fetch_assoc()) {
$total = mysqli_num_rows($result);
$store = $rows['store'];
$productId = $rows['productId'];
你不能做到這一點,你的連接具有一個字符串數組,bdway我不是一個誰downvote它 – Sherlock
檢查你的數據庫連接工作 –
,而內部while循環 – Ramki