Re: how to move into a recordset?
- From: Stefan Rybacki <stefan.rybacki@xxxxxxx>
- Date: Tue, 27 Sep 2005 16:58:41 +0200
chris wrote:
Hi,
Suppose i need to know the number of records before showing them. With the first loop, i get the number of records, but I think the pointer in the recordset remains at the end of the recordset, because the second loop gives nothing. Is there a way to put the pointer to the beginning? The code: $numofrec=0; $connect = odbc_connect ('DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\mytable.mdb', '', ''); $query = odbc_exec($connect, "select * from mytable;"); while ($row = odbc_fetch_array($query)) { $numofrec++; } echo $numofrecl;
while ($row = odbc_fetch_array($query)) { $f1 = odbc_result($query, 1 ); .... echo $f1 ... }
Thanks
Chris
There should be a function like odbc_num_rows
Regards Stefan .
- References:
- how to move into a recordset?
- From: chris
- how to move into a recordset?
- Prev by Date: Re: Warning: array_merge()
- Next by Date: Any experience with "Zend Optimizing" popular scripts?
- Previous by thread: how to move into a recordset?
- Next by thread: Re: how to move into a recordset?
- Index(es):
Relevant Pages
|