LIMIT with MSSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
Is there anybody who succed in doing per/page listing from a MS SQL Server db.
knowing that mssql doesnt support LIMIT like mysql and it uses TOP.
i didnt find an optimized way to make a per/page script.

Here's what am doing know :

to replace a MySQL "SELECT FROM ........ LIMIT $x,$y"
i did this with MSSQL :

:1              $query = "SELECT FROM ........"; //Without limit
:2              $ligne = fetch_assoc(query_bd($query));
:3              $temp = Array();
:4              for ($i=$debut;$i<($x+$y);$i++) {
:5                      if (isset($ligne[$i]))
:6                              $temp[] = $ligne[$i];
:7              }
:8              $ligne = $temp;

am loosing time between lines 4 to 7 when i have a big big array :(

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux