Re: mssql_prev_result()???
| From: | 1LT John W. Holmes | Date: | Fri, 03 May 2002 19:40:06 +0000 |
| Subject: | Re: mssql_prev_result()??? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95961@lists.php.net to get a copy of this message | ||
MSSQL doesn't support LIMIT.
You can use TOP, like SELECT TOP 10, * FROM users.
I think that's the syntax. I don't know if there is a way to say "return
rows from 10 - 20" in MSSQL.
---John Holmes...
----- Original Message -----
From: "Kevin Stone" <kevin@helpelf.com>
To: "PHP-general" <php-general@lists.php.net>; "Joshua E Minnie"
<josh@acsurf.net>
Sent: Friday, May 03, 2002 12:54 PM
Subject: Re: [PHP] mssql_prev_result()???
> You can navigate through records with Next and Previous buttons by using
> LIMIT in your query statment.
> ----------------------------------------------------
> <? // index.php
> if (!isset($i))$i=0;
> // Retrieve 1 rows starting at row $i
> $query = "SELECT * FROM mytable LIMIT $i,1";
> $result = mysql_query($query, $db);
> ?>
>
> <<
> <a href="index.php?i=<?echo $i--;?>">PREVIOUS</a>
> ||
> <a href="index.php?i=<?echo $i++;?>">NEXT</a>
> >>
>
> <?
> // ... print result from query here...
> ?>
> ------------------------------------------------------
>
> Hope this helps,
> Kevin
>
>
> ----- Original Message -----
> From: "Joshua E Minnie" <josh@acsurf.net>
> To: <php-general@lists.php.net>
> Sent: Friday, May 03, 2002 10:35 AM
> Subject: [PHP] mssql_prev_result()???
>
>
> > Does anybody know of a good way to get the previous result in a query
> > result?
> >
> > The query looks like this: SELECT * FROM [users]. This will return a
> result
> > set of 30 to 40 users.
> >
> > The reason I need to grab the previous is because I would like to be
able
> to
> > "virtually" scroll through my data in the table. Here is some
psuedocode
> of
> > what I am trying to do:
> >
> > <the form>
> > //fields to be filled by the user data that comes in from each query
> > <button value=previous user onClick=get_prev_user()>
> > <button value=next user onClick=get_next_user()>
> > </the form>
> >
> >
> > --
> > Joshua E Minnie/CIO
> > josh@acsurf.net
> > Phone: 616.276.9690
> > Fax: 616.342.8750
> > Nextel: 616.862.2847
> >
> > "Don't work for recognition, but always do work worthy of recognition."
~
> > Unknown
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>