sql server - MSSQL query not working after adding PHP variable to the LIMIT -
this query have used in mysql environment before. when try using mssql. errors out on statement:
$result = mssql_query("select * driverappinfo order appdate limit $startrow, 20")
$startrow defined following:
if (!isset($_get['startrow']) or !is_numeric($_get['startrow'])) { $startrow = 0; } else { $startrow = (int)$_get['startrow']; }
does $startrow in query need surrounded single quotes? thank in advance
the limit
keyword translates top
in mssql / sql server land.
you'll need abstract depending on mysql / mssql. remember:
pdo not provide database abstraction; doesn't rewrite sql or emulate missing features. should use full-blown abstraction layer if need facility.
also i'll mention mssql depending on version limit, offset
might not supported. take @ this mssql pagination approaches.
Comments
Post a Comment