[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/wsr/ - Worksafe Requests


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: php-pagination-prepared.png (20 KB, 1472x540)
20 KB
20 KB PNG
Help with prepared statements in PHP?

Trying to limit the number of rows/results but I dont know how to do it in a prepared statement. How do I fix this code? I think I need to put something in the bindparam thing.
The extra variables are for pagination, which complicates the code a bit.
>>
File: 1702014720186798.png (25 KB, 638x371)
25 KB
25 KB PNG
>>1499667
Well try to see if your variables are correct, and make sure they are integers. Track all variables and see what causes the error.

I just tried pic related and it works.

Also I don't think "select top 5 * from" is correct in MySQL, it looks like code for some other SQL engine. (unless they added it in the latest version or something, I've literally never seen it). Just use limit 5.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.