On Tue, Mar 4, 2008 at 8:12 AM, Jason <[EMAIL PROTECTED]> wrote:
>
> I am getting no where with the documentation.
>
> function view($name = null) {
> $this->PageControl->name = $name;
> $this->set('post', $this->PageControl->read());
> }
>
> This outputs the following...
>
> WHERE `PageControl`.`id` = 'index' LIMIT 1
>
> I want it to output
>
> WHERE `PageControl`.`title` = 'index' LIMIT 1
I don't quite follow what you're trying to accomplish here.
First, why are you assigning a value to $this->PageControl->name?
Second, the proper format for using read() is that you either set the
ID of the row you want before doing it:
$this->PageControl->id = 17;
$this->set('post', $this->PageControl->read());
or you pass it as the second argument of the read() method
$this->set('post', $this->PageControl->read(null, 17));
If you are trying to do find all records where PageControl.title =
'index', you can use the findAll() method
$this->set('post', $this->PageControl->findAll(array('title' =>
'index'), null, null, 1);
http://api.cakephp.org/1.2/class_model.html
Hope that helps, and I hope I've understood your problem.
--
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---