|
|||
|
Hi all,
first of all. I know some PHP, but I am new to Zend Framework. My colleague set up the site, and already made some logic. He' s gone, and I need to get into the site now. What I would to do is show the number of customers I have in my DB. What would be the best/easiest way to do this? I am kind of lost in my first hours/days on the framework. All help really appreciated. Michel |
|
|||
|
Assuming $db is the connection to your database and "customers" is your table:
$query = $db->select()->from('customers', array('count'=>'COUNT(*)'); $howMany = $db->fetchOne($query); // $howMany is what you're looking for
__________________
------------------ Loris Candylaftis |
|
|||
|
Thx for helping me. I need to put this in the Model, right? Like this?
PHP Code:
Any ideas? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|