PDA

View Full Version : Replace the date in entire database


amoree
01-05-2006, 05:25 PM
Hello,

Is there a way to replace the date in entire database ?

I have marage two database to my forum but i need to change all date that its on the old database from 2003 to 2005 because my old database its old and i need to change all the date from mysql Query by a command line such as

UPDATE post SET pagetext = REPLACE(pagetext,'2004','2005')

and if that command i sued its right how can i update it in my from so it will be shown with the new date?

also is there a way to change none english LANG in mysql because i used arabic fonts by using the same command but it wont work:(

Thanks and best regards

AN-net
01-05-2006, 07:59 PM
the of the post or dates in posts?

if you want to change the date of post your query wont work as all dates are stored as EPOX timestamps which are calculated in seconds since 1969. a query that should work is

UPDATE ~TABLEPREFIX~posts SET timestamp=timestamp+94348800

amoree
01-05-2006, 08:09 PM
Hello,

Thanks for the fast replay :)

I need to change the user registertion and user post
from 2002 To 2005

For example if i want to change all posts year date that were made at 2002 to 2005 , what will be the correct formula? , in addition what i need to type in the timestamp , in the following code i wrote 2002 , also when i try to submit the query i get sql error , so whats the tableprefix that need to be typed? in the following code i removed the prefix and put post only cause there is no table called posts , just post.
also is this correct (94348800=3 years from 2003 to 2005 )?

UPDATE post SET timestamp=2002+125798400

amoree
01-07-2006, 01:56 PM
Hello,

No Answer :((((

AN-net
01-08-2006, 12:19 AM
sorry i really came up with that query out of my ass
but i was close :D
anyways here is what you're looking for
PLEASE KNOW THIS WILL UPDATE ALL POSTS!!!

UPDATE ~TABLE_PREFIX~post SET dateline=dateline+9434880

replace ~TABLE_PREFIX~ with your table prefix you defined in config.php or if you do not have one just remove it.