Re: how to move into a recordset?



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
.



Relevant Pages

  • how to move into a recordset?
    ... 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? ... Prev by Date: ...
    (alt.php)
  • Re: [C++] help resolve a dilema regarding assignment of pointers
    ... Chris wrote: ... the file stream pointed to the ifs member when processing of the file is ... struct is defined as static it never does; ... close the stream, and if successful, the this pointer is returned. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: dhcpenumsubnets
    ... Hi Chris, ... In order to do that it requires you pass a pointer to a ... > in DhcpEnumSubnets): ... > DWORD getnum() ...
    (microsoft.public.win32.programmer.networks)
  • Re: dhcpenumsubnets
    ... Hi Chris, ... In order to do that it requires you pass a pointer to a ... > in DhcpEnumSubnets): ... > DWORD getnum() ...
    (microsoft.public.win32.programmer.networks)
  • Re: Simple loop optimization
    ... Chris wrote: ... >> I'm interested in finding out something that's been bugging me for a ... does it make sense to assume that the vanilla Sun ... >> JDK compiler would spot this, and would optimize the first loop to be ...
    (comp.lang.java.programmer)