AW: AW: AW: AW: [PHP-DB] php and OCI

2001-02-14 Thread Matthias Kopolt
MAYBE THERES ANOTHER WAY; but before selecting or fertching all you wont know Are you saying that, in php, every query has to be perfomed twice, if you want to know the number of rows in selection (before the fetch loop)? Matthias Kopolt wrote: > OK: > > imagine you want to find all rows wher

Re: AW: AW: AW: [PHP-DB] php and OCI

2001-02-14 Thread Valerio Ferrucci
Are you saying that, in php, every query has to be perfomed twice, if you want to know the number of rows in selection (before the fetch loop)? Matthias Kopolt wrote: > OK: > > imagine you want to find all rows where COLOR = 'foo' : > > $st1 = ociparse ($conn, "SELECT count(*) FROM myTable WH

AW: AW: AW: AW: [PHP-DB] php and OCI

2001-02-13 Thread Matthias Kopolt
>and to get rows, say, from 20 to 40? >Is it ok to write: >"select * from (select * from table where foocondition order by foo) where >rownum >= 20 AND rownum <= 40" its not that easy, as oracle start counting with the first retrieved row, so rownum > x will wait for ever, as oracle will never st

AW: AW: AW: [PHP-DB] php and OCI

2001-02-13 Thread Matthias Kopolt
OK: imagine you want to find all rows where COLOR = 'foo' : $st1 = ociparse ($conn, "SELECT count(*) FROM myTable WHERE COLOR = 'foo'"); ociexecute($st1,OCI_DEFAULT); ocifetch ($st1); $number_of_rows = ociresult ($st1, 1); //e.g. 372 $st2 = ociparse ($conn, "SELECT ID, NAME FROM myTable

AW: [PHP-DB] php and OCI

2001-02-13 Thread Matthias Kopolt
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