我有這樣的MySQL查詢,我想提出的mysqli兼容,並在同一時間更有效率?提前感謝!PHP的MySQL分頁 - 轉移到mysqli的
我的代碼是
$query = "SELECT COUNT(*) as num FROM table";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
$limit = 15;
$start = 0;
$sql = mysql_query("SELECT * FROM table ORDER BY id DESC LIMIT $start, $limit") or die(mysql_error());
那你試着和你在哪裏卡住? –