Limit綁定參數(shù)時查詢不出數(shù)據(jù),不加綁定參數(shù)才會有數(shù)據(jù)。
查詢有數(shù)據(jù):
$sql = 'select * from `article` WHERE `user_id`=:userId LIMIT 0 , 10 ';
查詢無數(shù)據(jù)
$sql = 'select * from `article` WHERE `user_id`=:userId LIMIT :limiter , :offseter ';
$stmt->bindParam(':limiter', $limit);
$stmt->bindParam(':offseter', $size);