Re: odbc_num_rows ??

From: Date: Wed, 27 Sep 2000 14:36:06 +0000
Subject: Re: odbc_num_rows ??
Groups: php.windows 
Request: Send a blank email to php-windows+get-2816@lists.php.net to get a copy of this message
odbc_num_rows() is driver dependant. Some drivers returns the value and some returnd -1. - Frank >Howdy All > >The following code had two ways of counting the number of rows >returned in a result. The first uses a loop counter, the seconf the >odbc_num_rows function. Any ideas why the second doesn't work. >It returns -1, the error code. > >The database is an Access 97 DB. > >The value of $rows is correct, but $num_rows is -1. > >$conn = odbc_connect("glenwood","",""); >$query = "select * from news"; >$result = odbc_exec($conn, $query); > >while($row = odbc_fetch_row($result)) { > $rows++; >} > >$num_rows = odbc_num_rows($result,"id"); > >Warwick Chapman (1999) >Assistant IT Manager >Glenwood High School, Durban, South Africa >031 2055241 >083 7797094 >www.glenwoodhighschool.co.za > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net >For additional commands, e-mail: php-windows-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.windows (#2816) next »