-1

Insted;

SELECT * FROM payments WHERE user_id = 1 ORDER BY created_at DESC LIMIT 1,1

Help me convert this into PDO Statements.

  • 1
    The error is pretty clear: "_you have an error in your SQL syntax_", so print your `$query` before preparing your statement, look at what you've made it generate, and then use that information to fix your code. Because right now it's generating "not valid SQL". – Mike 'Pomax' Kamermans Jan 23 '22 at 19:38

1 Answers1

0

I would do something like

print_r($query);

now you will see the sql

go to phpmyadmin or mysql and place your sql

usually its an error of sql statement