Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql fetch next 10 rows pdo

// You could have your values in variables (or hardcoded)
$offset = 0;
$limit = 5;

$statement = $pdo->prepare('SELECT * FROM livro ORDER BY id OFFSET :offset ROWS FETCH NEXT :limit ROWS ONLY');

// Next you need to bind the values
$statement->bindValue(':offset', (int) $offset, PDO::PARAM_INT); 
$statement->bindValue(':limit', (int) $limit, PDO::PARAM_INT); 

// Now execute your statement
$statement->execute();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sql #fetch #rows #pdo
ADD COMMENT
Topic
Name
5+6 =