I can't use variables defined with "SET" in offset in MariaDB.
error returned from database: 1064 (42000): 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 'CAST(? AS CHAR) OFFSET CAST(? AS CHAR)' at line 1
I'm defining the variables like this:
set limite = 10;
set offset = (COALESCE($page, 1) - 1) * $limite;
And then I'm trying to use them in the consultation:
...
order by
id desc
limit $limite
offset $offset;