Subject Re: [firebird-php] Iterating through results.
Author Uwe Oeder
Thank this helped a lot. However is there anyway in which I can know how
many rows are in the result set before I run through the data. So is there
anything equivalent to the mysql mysql_num_rows() function in firebird ? It
is important for me how many rows were returned from a query as this will
influence what further script must run.

At 03:16 PM 10/7/2004, you wrote:

>Hallo Uwe,
>
>
>On 10/7/2004 at 1:34 PM Uwe Oeder wrote:
>
> > I am using Apache 2.0.52 , PHP 5.0.2 , Firebird 1.5.1
> > I am using the php_interbase.dll extension.
> >
> > Question 1 :
> > Is there any newer version or a .dll specific for firebird ?
>
>I'm using the php_interbase functions, and know of nothing newer or
>firebird specific.
>
> >
> > I prepard the following query:
> > $DBHandle = ibase_connect ($host,$username,$password) or
> > die ("error in db connect") ;
> >
> > $SQLStmt = "SELECT CountryName FROM Country ORDER BY CountryName" ;
> > $SQLQuery = ibase_prepare($SQLStmt) ;
> > $SQLData = ibase_execute($SQLQuery) ;
> >
> > $TotalCountry = ibase_affected_rows() ;
> > echo "TotalCountrys = " . $TotalCountry ;
> > for ($Countrys = 1 ; $Countrys <= $TotalCountrys ; $Country++)
> > {
> > $row = ibase_fetch_row($SQLData) ;
> > echo $row[0] ;
> > }
> >
> > Question 2 :
> > There should be more than 50 records displaying but interbase/firebird
> > reports 0 were affected.
> > How do I iterate through the resultset of a query ?
> >
>
>Try it this way instead:
>
> $DBHandle = ibase_connect ($host,$username,$password) or
> die ("error in db connect") ;
>
> $SQLStmt = "SELECT CountryName FROM Country ORDER BY CountryName" ;
> $SQLQuery = ibase_prepare($SQLStmt) ;
> $SQLData = ibase_execute($SQLQuery) ;
>
> if ( !$SQLData )
> {
> echo "Unexpected query error for $query<br>";
> }
> else
> {
> $TotalCountry = 0;
> while ( ($row = ibase_fetch_row( $SQLData ) ) != false )
> {
> $TotalCountry++;
> echo $row[0];
> }
> echo "TotalCountrys = " . $TotalCountry ;
> ibase_free_result( $SQLData );
> }
>
>
> > Question 3 :
> > Where can I find all the functions available to me ?
> >
> >
>
>The PHP documentation has a complete listing of ibase/firebird functions
>in the function list for Firebird/Interbase. See
><http://www.php.net/manual/de/ref.ibase.php>http://www.php.net/manual/de/ref.ibase.php
>for a list auf Deutsch.
>
>HTH,
>
>Dan.
>
>
>
>Yahoo! Groups Sponsor
>ADVERTISEMENT
><http://us.ard.yahoo.com/SIG=12926s7sc/M=294855.5468653.6549235.3001176/D=groups/S=1705007183:HM/EXP=1097241401/A=2376776/R=0/SIG=11ldm1jvc/*http://promotions.yahoo.com/ydomains2004/index.html>
>click here
>
>[]
>
>
>
>----------
>Yahoo! Groups Links
> * To visit your group on the web, go to:
> *
> <http://groups.yahoo.com/group/firebird-php/>http://groups.yahoo.com/group/firebird-php/
>
> *
> * To unsubscribe from this group, send an email to:
> *
> <mailto:firebird-php-unsubscribe@yahoogroups.com?subject=Unsubscribe>firebird-php-unsubscribe@yahoogroups.com
>
> *
> * Your use of Yahoo! Groups is subject to the
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.768 / Virus Database: 515 - Release Date: 9/22/2004



Mr. U. Oeder
Head of IT Departement

Creative-Logic
1 Dr Michael de Kock St.
Northern Industrial Area
Windhoek
Namibia

P.O. Box 9274
Phone : 061-262 941
Fax : 061-262 130
Email : uweo@...



----------


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.768 / Virus Database: 515 - Release Date: 9/22/2004


[Non-text portions of this message have been removed]