how to move into a recordset?



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


.



Relevant Pages

  • Re: how to move into a recordset?
    ... chris wrote: ... Suppose i need to know the number of records before showing them. ... first loop, i get the number of records, but I think the pointer in the ... Is there a way to put the pointer to the beginning? ...
    (alt.php)
  • Re: RSA question
    ... I'm pretty sure I've seen a pointer to a paper ... showing that RSA-PSS and RSA-OAEP with the same key is safe; ...
    (sci.crypt)
  • Re: guide error
    ... what's actually showing. ... I've tried resetting up the guide multiple times. ... Can anyone give me some pointer? ...
    (microsoft.public.windows.mediacenter)
  • Re: can i find the record number over which my mouse is positioned
    ... if you are showing the data in a grid, you might take a look at the ... >>> Is it possible to get the record number over which my mouse pointer is ... >> ENDIF ...
    (microsoft.public.fox.helpwanted)
  • Re: difference between address and pointer
    ... by showing that an address is not an ... But the difference goes even deeper: a pointer ... The term "address" is also commonly used to refer to a raw machine ...
    (comp.lang.c)