AW: [PHP-DB] php and OCI
| From: | Matthias Kopolt | Date: | Tue, 13 Feb 2001 12:17:34 +0000 |
| Subject: | AW: [PHP-DB] php and OCI | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6575@lists.php.net to get a copy of this message | ||
you can use the meta column rownum
e.g. where rownum<20
note: you need to do subselects and (where rownum > 1) will never return a
line !!!
you could use something like
select * from
select rownum "rownumber", mydata from mytable order by
mycol
) where rownumber > 10 and rownumber < 20;
should work ...
2. i know there is a phpfunction for that ocifetchedrows or something like
that
mk
-----Ursprungliche Nachricht-----
Von: Valerio Ferrucci [mailto:valfer@flashnet.it]
Gesendet: Dienstag, 13. Februar 2001 12:54
An: php-db@lists.php.net
Betreff: [PHP-DB] php and OCI
Hi,
I'm using php with oracle to select data in a db.
1)
My code is:
putenv("ORACLE_HOME=/xx");
putenv("ORACLE_SID=xx");
$conn = ociLogon("xx","xx","xx");
$st = ociparse($conn,"select * from myTable order by MYFIELD");
$res = ociexecute($st,OCI_DEFAULT);
while(ocifetch($st))
{
...
}
This is ok, BUT:
I want to show records in pages with 20 records each one. How can I
obtain this?
I see that php asks all thousands records to (remote) oracle server,
slowing time. Is there something like:
ociexecute($st,OCI_DEFAULT, fromRec, toRec);
2)
How can I know the total records in current selection?
Thanks
==================================================================
Valerio Ferrucci Tabasoft Sas
valfer@flashnet.it http://tabasoft.ancitel.it
taba@flashnet.it
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net