Yii Framework Forum: Insert Record Into Database Automatically On A Specific Date - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Insert Record Into Database Automatically On A Specific Date Rate Topic: -----

#1 User is offline   pinky 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 27-July 12

Posted 17 November 2012 - 07:16 AM

I have a record that I do not want to insert into the database immediately. I want to insert a record into the database automatically only when it reaches a specific date.

Anyone have any idea how I can do it?
0

#2 User is offline   phtamas 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 529
  • Joined: 26-February 11
  • Location:Mezőtúr, Hungary

Posted 17 November 2012 - 07:32 AM

View Postpinky, on 17 November 2012 - 07:16 AM, said:

I have a record that I do not want to insert into the database immediately. I want to insert a record into the database automatically only when it reaches a specific date.

Anyone have any idea how I can do it?


Create a new table with structure similar to the original table and use it as a temporary storage. Then set up a cronjob that moves the rows to the original table when necessary.
0

#3 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,327
  • Joined: 21-February 11
  • Location:Greece

Posted 17 November 2012 - 07:50 AM

You could override the beforeSave method on your model, save the data in another table and cancel the save of the first model.
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users