Re: numRows() and MySQL

From: Date: Wed, 22 May 2002 17:48:43 +0000
Subject: Re: numRows() and MySQL
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1428@lists.php.net to get a copy of this message
my fault. i forgot to call my new db connection class! whoops Thanks David On Wednesday, May 22, 2002, at 12:14 PM, Michelle Manning wrote:
David, You need to use the Result set from your query to find out the number of rows that were 'found' by your query.  I may be missing something, but hopefully this gets you farther.  Good Luck! Michelle   $selectAssocSQL = "select keypid from association"; $db = $vars->make_db_connection(); $selectAssoc = $db->query($selectAssocSQL);   **$results = $selectAssoc->execute(); if (DB::isError($selectAssoc)) { die ($selectAssoc->getMessage()); } else { //display assoc count **echo $results->numRows(); } ----- Original Message ----- From: David Dahl To: pear-general@lists.php.net Sent: Wednesday, May 22, 2002 10:51 AM Subject: [PEAR] numRows() and MySQL I have: Linux/MySQL/PHP 4.1.2/Pear from CVS 5/16/2002. what is wrong woth this numRows() usage? $selectAssocSQL = "select keypid from association"; $db = $vars->make_db_connection(); $selectAssoc = $db->query($selectAssocSQL); if (DB::isError($selectAssoc)) { die ($selectAssoc->getMessage()); } else { //display assoc count echo $selectAssoc->numRows(); } This error comes back: Fatal error: Call to a member function on a non-object in /Library/WebServer/Documents/condosystems/ASPAdmin/action_cell.php on line 9 TIA, David Dahl ddahl.com -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.general (#1428) next »