The query code should go in the controller. It might look something
like this:
$this->set('stats',$this->Model->find('all',array('fields'=>array
('field1','field2'))));
In your view code you would do something like this:
<?php foreach($stats as $stat): ?>
<table>
<tr>
<td><?php echo $stats['table_name']['field_name']; ?></td>
</tr>
</table>
<?php endforeach; ?>
On Feb 3, 12:23 am, aman batra <[email protected]> wrote:
> hello..i want to create a table in my admin page so that i can see the
> stats of site directly. how can i make a table and then how to fetch
> the mysql queries of number of views and no of entities on my site on
> the table column. the code for table must be in the view.ctp ?? and
> where to write the queries that are to appear in the coloumn of table?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---