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
farid
Forum Commoner
Posts: 54 Joined: Thu Nov 11, 2004 4:20 pm
Location: Mexico
Post
by farid » Tue May 24, 2005 10:53 am
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!!
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Sat May 28, 2005 4:49 am
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%'");