hi
but the sql used will be inserting more than 10 records.
how can that function do?

please advise as i am very new to cakephp

thanks
chris

On Wed, Apr 10, 2013 at 8:17 PM, Soumavo Chatterjee <[email protected]>wrote:

> $this->data['Modelname']['fieldname']=value;
>
> Check this it will work
>
>
> On Wed, Apr 10, 2013 at 5:39 PM, Yen Hua Chuah <[email protected]> wrote:
>
>> hi
>> I would want to do a mass insert records into a table using sql
>>
>> e.g. insert into outdatedpost select * from post where date_posted <
>> current_date()
>>
>> is there a way to do this in cakephp?
>>
>> this function will be run every morning say 12.30 midnight
>>
>> Hence i have to create a shell object for the outdatedpost.
>>
>> Then in the shell object, i will call the Outdatedpost controller to
>> perform this sql
>>
>> $this->outdatedposts->query("insert into outdatedpost select * from post
>> where date_posted < current_date()")
>>
>> however, it seems that cakephp will give me an error on the query()
>> function
>>
>> please help!!!
>>
>> thanks
>> chris
>>
>>  --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> *Regards
>
> --
> Soumavo Chattaraj
>
>
> *
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/d8SUYXDzXPk/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to