Welcome Guest, Not a member yet? Register   Sign In
How to manage dates on an auto refreshing demo site
#16

Quote:Hmm, if that is the case then it sounds like an initial bad planning phase for your data( please don't take that the wrong way.)

It was definitely bad planning on my part.

The problem was how I decided to implement the wiping. With a text file containing all the sql for updating the data, how could I even find the date data to implement a php change on. Especially since any hunt of that data might pull out text inputs of dates in user input fields.

However, I have a solution.

On the development site I have added the demo wiping script to update the data to the same as on the demo site. Then yesterday I spent ages writing a script that updates all the date fields, based around today and the current month. One I have run that update I can then simply export the database data back into an sql file, to use on the demo site for wiping.

Apart from a few tables, most of the dates I could do as random intervals from a given date. I also managed to code it all into a single function that I call table by table, from a singe array of table names and date fields, which I was quite pleased with. There were still a few more complicated tables that I had to write individual scripts for, but it is done now.

I also now have a mechanism to easily refresh and edit all the demo data, making it better or to fit new functionality. I am quite pleased with that.

Sorry I went on for so long. And if my explanations were a bit confusing. It was a strange situation that was definitely my fault in that I didn't realize my demo data dates would go out of date. With hindsight I should have seen that coming.

Thanks for all your input and help, it really did help me to clarify the problem and possible solution in my own mind.

Best wishes,

Paul.
Reply


Messages In This Thread
RE: How to manage dates on an auto refreshing demo site - by PaulD - 10-25-2015, 02:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB