PHP and MSSQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
farid
Forum Commoner
Posts: 54
Joined: Thu Nov 11, 2004 4:20 pm
Location: Mexico

PHP and MSSQL

Post by farid »

:oops: Hi y'all I'm having problems with a query that I'm making in mssql with PHP, the thing is that I seem not to be able to find a way to limit the query.

Code: Select all

$sql_results = mssql_query("SELECT folio_div1 FROM bd_cac WHERE folio_div1 LIKE '%$query%' LIMIT $limit,10");
Thanks!!
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

For MSSql, try "select TOP X ..." exchanging the X with the limit.

Code: Select all

$sql_results = mssql_query("SELECT TOP $limit folio_div1 FROM bd_cac WHERE folio_div1 LIKE '%$query%'");
Post Reply