I would like to ask how can I can display only some data from a table to the user’s view, using mysql query in cakephp.
Example, I have a table Students. There are two fields, name and age.
Clerk, 21
Mary, 23
Matt, 21
Clara, 21
Here is my query, SELECT * FROM Students where age='21';
How and where can I apply it in cakephp? Thanks.
What Have You Tried? … if you really want help, you’re going to need to provide more info … have you looked at the CakePHP book online …
Either way, as a bit of a starter, somewhere in your controller you will:
And then in your view:
Or something to that effect …