Re: odbc_num_rows ??

From: Date: Thu, 14 Sep 2000 11:35:17 +0000
Subject: Re: odbc_num_rows ??
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2646@lists.php.net to get a copy of this message
A "feature" of MS ODBC Drivers I'm afraid. See the PHP manual Derek ----- Original Message ----- From: "Warwick Chapman (Budgee)" <Budgee@ghs.kzn.school.za> To: <php-windows@lists.php.net> Sent: 14 August 2000 12:03 Subject: [PHP-WIN] odbc_num_rows ?? > 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 (#2646) next »