You are here: Re: how to move into a recordset? « All PHP « IT news, forums, messages
Re: how to move into a recordset?

Posted by steve on 09/27/05 21:11

first...odbc_* functions suck. second...why use access...it sucks. mysql and
msde are free. upgrading ain't hard.

odbc_fetch_array() has known issues (as well as most of the odbc_) ...
you've got to do the work in rtfm to find out the work arounds. for you, i'd
use com and create an adodb object an hit the db. it's much easier and fails
less often.


"chris" <frx@srgs.ze> wrote in message
news:vsOdnaOOQrLtzqTeRVnytA@scarlet.biz...
| 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
|
|

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация