Re: results over multiple pages
| From: | Matt Parlane | Date: | Tue, 07 May 2002 02:28:27 +0000 |
| Subject: | Re: results over multiple pages | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13585@lists.php.net to get a copy of this message | ||
I don't think SQL Server supports the LIMIT statement (this isn't MySQL
remember...)
From memory SQL Server uses the TOP statement - something like
"SELECT TOP 5 <rest of SQL statement here...>" although I'm probably wildly
off as far as syntax goes.
You can also use a percentage for the number of rows you want.
Hope that helps...
Matt
"Hugh Bothwell" <hugh_bothwell@hotmail.com> wrote in message
news:20020507022303.50303.qmail@pb1.pair.com...
>
> > if ($currentPage > 1) {
> > $host="localhost";
> > $DB="testDB";
> > $user="sa";
> > $pass="";
>
> Umm... if that's the only place you use these values,
> why not specify them inline? Easier to read, for sure.
>
> > $connect = mssql_connect($host,$user,$pass) or die ($host." not
> > accessible.");
> > if ($DB) mssql_select_db($DB)or die('USE '.$DB.' failed!');
> > $query = "SELECT first_name, last_name FROM individual WHERE last_name
> > LIKE '$searchField%' ORDER by last_name ASC";
>
> Surely LIMIT would be a better way to do this?
>
>
>