Hi,
You might have a look at fetchOne() instead of fetchAll().
Then you can do return (int) $this->fetchOne(...);
Regards,
Jachim Coudenys
-----Oorspronkelijk bericht-----
Van: Thomas List [mailto:
[hidden email]]
Verzonden: dinsdag 5 april 2011 21:17
Aan:
[hidden email];
[hidden email]
Onderwerp: [fw-mvc] Zend_Db_Table_Abstract
Hi,
I am trying to return the max value of a row in my database. The code I used is as follows:
public function getMaxLogId()
{
return $this->fetchAll(
$this->select()
->from($this, array(new Zend_Db_Expr('max(log_id) as log_id')))
);
}
which returns an object. How do I convert the object to an integer?
I don't really see anything concrete in the discussion groups and it's really frustrating.
Regards,
Thomas
--
This email was Anti Virus scanned.