Re: problem with num_rows (OCIRowCount)

From: Date: Mon, 19 Mar 2001 16:32:51 +0000
Subject: Re: problem with num_rows (OCIRowCount)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7605@lists.php.net to get a copy of this message
I believe OICrowcount() only returns the number of affected DML affected rows, ones affected by insert or update. Use two seperate queries, one for the count, then another for the data. "SELECT COUNT(*) FROM yourTable WHERE yourWhereClause" Or read all the records into an array and count 'em as you read 'em. <- this could be very memory consuming. ""Mark"" <mfaine@bellsouth.net> wrote in message news:995b4h$jfv$1@toye.p.sourceforge.net... > Using phplib ---- db_oci8.inc > > > This function ( a method of Db_Sql class) is giving me problems. > > I've read in one place that it cannot be used for SELECT statements but in > another place that it can. > > function num_rows() { > return OCIrowcount($this->Parse); > } > > > Then in my code that uses it, I have > > > if($result->num_rows() < 1) > { > echo '<table width="100" > border=0><tr><td>&nbsp;<!--spacer > cell -->&nbsp;</td></tr>'; > echo '<tr><td><div class="errorMsg">No results > returned</div></td></tr></table>' > return false; > } > > This always returns 0, every time. I don't know why? > > How can I get around this. > > I need it to actually return the number of rows, or at least let me check to > see that there were rows returned from the query. > > -Mark > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#7605) next »