Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > ibProArcade Archive
SQL query to find games Details »»
SQL query to find games
Version: , by utw-Mephisto utw-Mephisto is offline
Developer Last Online: Feb 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-13-2006 Last Update: Never Installs: 0
 
No support by the author.

I am looking for an easy way to find the names of games, which never been played. Unfortunately it is not convinient when using arcade to sort them.

Is there a query I can run to get a list, which I can use in a simple script to deleted those games ? I have almost 1700 games and I would like to free up some space (no kidding )

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-14-2006, 08:56 PM
MrZeropage's Avatar
MrZeropage MrZeropage is offline
 
Join Date: Nov 2003
Location: Munich, Germany
Posts: 3,012
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This will provide a list of Game-Names with those never played:
SELECT gtitle FROM ".TABLE_PREFIX."games_list WHERE timesplayed=0

normally you should never remove games manually this way from games_list as there might be scores, tournaments ect. in the DB left using that game, but if "timesplayed" is 0 it never has been played, so no worry.
So you can alter that query to delete all games the have never been played, just remember to remove the .swf and .gif files
Reply With Quote
  #3  
Old 08-14-2006, 09:39 PM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot .. it would be soooo perfect if you could also delete selected games in one go (Functions to execute with selected Games) [/hint]
edit:
Ok, the query did not work, but I just realised that (if I modify the query) it would not remove the game from the server anyway just from the database which does not really help ... dammit ... and since it goes back to the main menu after I deleted one game, you can imagine how much work it is to delete something like 800 games by hand

This was the error btw.:

Quote:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: 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 '".TABLE_PREFIX."games_list WHERE timesplayed=0' at line 1
But again - I won't need it unless I find a way to delete those games from the server AND filesystem ..
Reply With Quote
  #4  
Old 08-14-2006, 09:52 PM
MrZeropage's Avatar
MrZeropage MrZeropage is offline
 
Join Date: Nov 2003
Location: Munich, Germany
Posts: 3,012
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you need to replace ".TABLE_PREFIX." with your tableprefix



and you realized my main problem for deleting multiple selected games - there have to be different steps to be done with each game:
- delete from filesystem
- delete from database
- delete scores, highscores from that game
- delete tournaments with that game


What you can do:
AdminCP -> Game List -> sort by "times played" -> mark/select all games never played and deactivate them
Reply With Quote
  #5  
Old 08-14-2006, 09:58 PM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well .. I think I have to do it step by step then since deactivating doesn't really give me back my diskspace :P

At least I have something which keeps me busy during the nightshift
Is there a file or something I can change so that after I delete a game, it jumps back to the gamelist again instead of the main menu ?
Reply With Quote
  #6  
Old 08-14-2006, 10:05 PM
MrZeropage's Avatar
MrZeropage MrZeropage is offline
 
Join Date: Nov 2003
Location: Munich, Germany
Posts: 3,012
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

open the "delete"-link in a new tab/browser
Reply With Quote
  #7  
Old 08-14-2006, 10:09 PM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah - I just thought outside the box myself LOL

just checked - I don't have a table prefix but I think there is still an error in your query - I think it should be

SELECT gtitle FROM games_list WHERE gcount=0
Reply With Quote
  #8  
Old 08-15-2006, 07:16 AM
MrZeropage's Avatar
MrZeropage MrZeropage is offline
 
Join Date: Nov 2003
Location: Munich, Germany
Posts: 3,012
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh ok

you are right: gcount !

sorry, timesplayed is userinformation...
Reply With Quote
  #9  
Old 08-15-2006, 05:31 PM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Deleting about 830 by hand is quite ?tzend ... only 231 to go
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04966 seconds
  • Memory Usage 2,269KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete