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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux