I have been working on a table selector with pagination using PHP. I can get it to work with mysql but when I change query and methods to postgres my query throws an ERROR.
Warning: pg_query(): Query failed: ERROR: LIMIT #,# syntax is not supported LINE 1: ...le_name, file_path FROM videos ORDER BY file_name LIMIT 0, 1... ^ HINT: Use separate LIMIT and OFFSET clauses. in /var/www/its/VersionC/Pagination/test2.php on line 14 ERROR: queryMysql wont query to database!
the query I have implemented.
$sql = "SELECT file_name, file_path FROM videos ".
"ORDER BY file_name LIMIT $from, $max_results";
I do know when writing queries for pagination MySQL uses LIMIT and Postgres uses LIMIT and OFFSET. When I place a OFFSET in query it basically throws same error as above. I have checked and double checked my functions and I feel highly my issue is with the query itself. If you have any recommendations or any way to help me fix this issue it would be beyond greatly appreciated. This is a big issue for me and I would love to learn and understand what is wrong and why for future. After my search for an answer I learned this is a on going problem for people trying to paginate with postgres using php to use a table selector.