> the first is about a conditions array, I can't find any documentation
> on how to integrate "ORDER BY" into an array formatted conditions
> statement like the one below. Does anyone know how to do this?
>
> $conditions= array
> ("or" =>
> array
> (
> "Post.title" => array("First post", "Second post", "Third
> post"),
> "Post.created" => "> " . date('Y-m-d', strtotime("-2 weeks"))
> )
> )
In the documentation (http://api.cakephp.org/
class_model.html#3acc0c31e381b7de7e21b57988ca326d) for the $this-
>model->find();
Model::find (
$conditions = null,
$fields = null,
$order = null,
$recursive = null
)
It has a separate value for the order by value.
> My second questions is about the $this->table->save() command. I'd
> like to do a save on multiple fields based on a field other than the
> id (ie "UPDATE tablename SET fields=values WHERE field_other_than_id =
> 'some value';"). Can I use the save function to do this or do I need
> to do it some other way? Thanks for your help.
$this->table->save() will insert if the table id isn't filled in
otherwise it'll try and update the current record.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---