FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php DB rotation
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
php DB rotation [message #176874] Tue, 31 January 2012 02:05 Go to previous message
Jim Lee is currently offline  Jim Lee
Messages: 2
Registered: January 2012
Karma:
Junior Member
I have a PHP server controller thatl read/write to Database table

PHP server will start read / write to a new DB table every week/monday
e.g.
table-1-2-2012
table-1-9-2012
table-1-16-2012
table-1-23-2012 ... etc

I think of 2 ways to do the DB table rotation

1) check the serve timestamp, if today's date is week of 1-23-2012,
then read/write to table-1-23-2012

2) have a unix corn job run every monday to generate a text file on
PHP server with DB table named on that date - on each PHP request,
check the text file's table name - then read/write to that DB table

any other solution to DB table rotation?

the first way check timestamp have a drawback when server's time is
not set to correct time, since there are many PHP server running for
load balance, it's not a good idea.

the second way is a better solution, but request additional setup -
cron job
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Freelance PHP Developer
Next Topic: enter search term via code?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 00:17:07 GMT 2024

Total time taken to generate the page: 0.15479 seconds