Re: Simulating ASP/ADO commands in PHP
| From: | Michael Kimsal | Date: | Fri, 08 Sep 2000 20:46:30 +0000 |
| Subject: | Re: Simulating ASP/ADO commands in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15945@lists.php.net to get a copy of this message | ||
I've discussed this with people on another list - personally, I don't
like the ADO method at all. It is very proprietary - you're asking how
to 'simulate' this in PHP, when the ADO method is a 'simulation' of
functionality the database engine should be providing.
I'm not up on ANSI92 standards - I'm not sure if LIMIT is in there, but it's
there in MySQL and I believe Postgres and Oracle (someone correct me if
I'm wrong). Having the database do this work is, imo, a much better
way of doing it. Of course, if you're using MSSQL server, you can't do it,
but many other databases will let you do this. (BTW, if anyone claims that
MS doesn't support LIMIT because it's not an officially approved standard,
what about MARQUEE?)
By NOT having it in MSSQL, and putting the functionality in the
ADO , it makes it easy to use MSSQL with other MS products, and
harder to use MSSQL with anything else.
In MSSQL, you can/could do a 'seek' to the first record in the set
- seek(90) for example, I think - the count 1,2,3,4,5 from there.
We're using this method right now and it's functional. I'd prefer to
use LIMIT, but it's not there.
I've jumped ahead - you never said you were using MSSQL (assumption
on my part). Are you using Access? I don't know if it even has the seek
function.
Bottom line is that whatever db you're using should have some info
about how to do this for you.
Stephen Schneider wrote:
> I use ASP quite a bit. In ASP there are commands that basically say "I want
> to display 5 records at a time out of this recordset." This makes it easy
> to tailor the viewing of recordsets. It also makes it easy to create
> navigation buttons to jump to any particular page. These commands in ASP
> are: AbsolutePage, PageCount, PageSize.
> To simulate this in PHP I can obviously get a count of returned records in a
> result set and form a loop to display that many at a time. How would I set
> it up (what commands) that would allow me to say "jump to the 3rd page -
> which would be records 11 - 15 if displaying 5 at a time"?
>
> Does that make sense?
> Thanks
> Stephen Schneider - MCSE
> Web Developer
> HKM Direct Market
> (216) 651 - 9500 (243)
> sschneider@hkmdm.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
==========================
Michael Kimsal
http://www.tapinternet.com
734-480-9961