RE: [PHP] Syntax to call a class' methods in your own class

From: Date: Wed, 24 May 2006 22:19:25 +0000
Subject: RE: [PHP] Syntax to call a class' methods in your own class
Groups: php.general 
Request: Send a blank email to php-general+get-236860@lists.php.net to get a copy of this message
> This works: > $rs= $this->conn->GetAll("SELECT title FROM content WHERE > page_id= ?", > $id); You can't iterate through an array like you are trying to do. Using the GetAll() function returns an array, you have to use the Execute() function to be able to iterate through $rs like you are trying to do: $rs= $this->conn->Execute("SELECT title FROM content WHERE page_id= ?",$id); > This fails: > while (!$rs->$this->conn->EOF) > { > // iterate through $rs > } Try: while(!$rs->EOF) { // do whatever $rs->MoveNext(); } You may want to take a look at the phpgacl (http://phpgacl.sf.net) class, it has integrated ADODB so it may be a good example for you to follow. HTH, Brady

« previous php.general (#236860) next »