Fatal error: Uncaught Exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1 query: SELECT id FROM project where id = (select max(id) from project where id < ) in /home/kiranjoshi/public_html/admin/lib/MysqliDb/MysqliDb.php:2006 Stack trace: #0 /home/kiranjoshi/public_html/admin/lib/MysqliDb/MysqliDb.php(1594): MysqliDb->_prepareQuery() #1 /home/kiranjoshi/public_html/admin/lib/MysqliDb/MysqliDb.php(649): MysqliDb->_buildQuery(NULL) #2 /home/kiranjoshi/public_html/Project-detail.php(51): MysqliDb->query('SELECT id FROM ...') #3 {main} thrown in /home/kiranjoshi/public_html/admin/lib/MysqliDb/MysqliDb.php on line 2006