Clearly I was being dumb, sorry that I posted without checking. Lesson learned about how LIMIT should work now.
There must be something wrong somewhere else as I was actually able to make the following work just fine on mysql with prepare and execute stmts. Try printing out your '$limit' string and/or doing a validate
if( $limit !~ /^\d+$/) { die("limit was '$limit' which is NaN"); }
"SELECT * FROM tablea WHERE id > ? LIMIT ?,?"
"SELECT * FROM tablea LIMIT ?,?"
"SELECT * FROM tablea LIMIT ?,10"
"SELECT id from tablea LIMIT ?,10"
"SELECT * from tablea ORDER BY id LIMIT ?,10"