Possible duplicate:
PHP PDO bindValue in LIMIT
I could not display the data when using LIMIT and / or OFFSET in the preparation instruction, but I can show "Lei Lei" if I do not use LIMIT and OFFSET, does the code look incorrect?
$statement = $conn->prepare("SELECT id,username FROM public2 WHERE username = :name LIMIT :sta OFFSET :ppage"); $name = "Lei Lei"; $statement->execute(array(':name' => $name,':sta' => $start,':ppage' => $per_page));
This was a change from the source code that worked:
$query_pag_data = "SELECT id,username from public2 LIMIT $start, $per_page"; $result_pag_data = mysql_query($query_pag_data) or die('MySql Error' . mysql_error());
proyb2
source share