Just hit the problem in a procedure that LIMIT only takes constants and not variables. So having to resort to a workaround being to put the query in a statement.
set @q = 'select * from t1 limit ?,?';
set @l1=10, @l2=1;
prepare q from @q;
execute q using @l1,@l2;
Problem is my actual query is 20 lines long so how do i put that in the set @ = without having to put the whole thing on one line.
set @q =
'select *
from t1
limit ?,?';
keeps giving me errors, what's the syntax for this ?