Need help with MYSQL Database command string !!!!!!!!!!!!

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
eb kevin
Registered User
Posts: 53
Joined: Fri Aug 24, 2001 6:00 am
Location: las vegas
Contact:

Need help with MYSQL Database command string !!!!!!!!!!!!

Post by eb kevin » Sat Jul 27, 2002 8:47 am

OK Here is the problem. My board was updated from 1.4.4 to the first PRE-RC1 of 2.0.. then RC2, RC3, RC4, then Final. So it went through a lot of changes. Due to the fact that I have 1,000 registered users, not about to dump the entire database.

Anyways, the issue is -- I pruned the topics when it was around 100,000 total posts on the board. It did removed it visually from viewtopic.php , but the database still has all the post data (posts, and posts_text).
Now I am up near 60,000 posts on the forum again, totalling near 160,000+ posts worth of data in database.

I need to run a MYSQL command line string to delete posts OLDER than a certain date (say March 3rd, 2002) and make it only specific to Forum number 1 (viewforum.php?f=1). That is the forum which takes up 90% of the board, all the other forums are archived type of forums I dont want to lose any posts.

If anyone can help, Thank you.

Here is the forum by the way-----
http://64.91.236.87/boards/index.php

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 » Sun Jul 28, 2002 10:45 am

You could probably use a SQL function, but I just know the PHP way offhand.

Use the strtotime() function to get the unix time stamp from a string date (see PHP manual)

Then you can run

DELETE FROM table WHERE time <= timestamp

table being the table name, time being the time column, timestamp being the unix timestamp

Locked

Return to “2.0.x Support Forum”