Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
I have a script that automatically creates forums as they are needed. but sometimes they aren't really needed and as a result I now have 5551 forums and most of them are empty. So I want to know what query to use to delete all the forums with 0 topics. I need to do this because the script I use to create the forums has stopped working and the only reason I can think of for this to be happening is because there are too many...
Here's the script that wont work incase that helps anyone with any other ideas of why it's stalling: http://www.schoolscandals.com/final/map.php but make sure you click on a US state and not canada, I haven't added canada yet.

Thanks everyone!

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
5551 forums? eek

What version threads are you using?


- Allen wavey
- What Drives You?
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
6.5.1.1 it appears

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
oops, didn't look shocked

And this actually should be in the 'new members/how do I' forum... moving there.


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Here's a practice query (just to make sure we're on the right track wink )

SELECT * FROM w3t_Boards
WHERE Bo_Threads = "0"

That will give you the forums that have zero topics.

Now, be sure and back up the w3t_Boards table and use this query to delete empty forums:

DELETE * FROM w3t_Boards
WHERE Bo_Threads = "0"

Warning, it will also delete your shoutbox "forum" if you have that installed... you may need to re-add it back in. I don't remember how to do an 'except' on that one smile


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
Script: /home/wa1ss1/public_html/final/admin/dodbcommand.php
Line#: 107
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM w3t_Boards WHERE Bo_Threads = "0"' at line 1
SQL Error #: 1064
Query: DELETE * FROM w3t_Boards WHERE Bo_Threads = "0"

but the first one worked

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
It's
Code
DELETE FROM w3t_Boards WHERE Bo_Threads = "0"

That reminds me, I should write an [sql] tag

Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
now i got a "Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
"

I've never been very good with these SQL queries

Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
Thanks!! I got it to work via phpmyadmin but the script still isn't working. Any idea why this would be?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
thanks ian smile

I have no idea why your script is not working, you could check the error logs and see why it is white-screening at: http://www.schoolscandals.com/final/gotoschool.php


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
any of these make sense to you?

[Thu Aug 3 14:38:16 2006] [error] [client 67.10.116.79] File does not exist: /home/wa1ss1/public_html/404.shtml
[Thu Aug 3 14:38:16 2006] [error] [client 67.10.116.79] File does not exist: /home/wa1ss1/public_html/final/gotoschool.phpb3c187aa
[Thu Aug 3 14:38:05 2006] [error] [client 67.10.116.79] File does not exist: /home/wa1ss1/public_html/404.shtml
[Thu Aug 3 14:38:05 2006] [error] [client 67.10.116.79] File does not exist: /home/wa1ss1/public_html/final/selectcity.phpbb0e912e


I mean, I know the file it's going to doesn't exist but that's because it's supposed to be creating it...

Last edited by SchoolScandals; 08/03/2006 5:03 PM.
Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
I figure it might help if i just go ahead and post the code that the script is using:

http://www.schoolscandals.com/gotoschool.txt


Last edited by SchoolScandals; 08/03/2006 5:22 PM.
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Have you tried running a repair table on the tables in question? Possible they have been corrupted with the thousands of forums added.


- Allen wavey
- What Drives You?
Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
I ran a repair via phpmyadmin but nothing seemed to happen.

Joined: Jul 2002
Posts: 135
Journeyman
Journeyman
Joined: Jul 2002
Posts: 135
I checked the database and the forums are not even being added... so perhaps that could have something to do with it?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
yeah, it sounds like it's not getting to that part.


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)