vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   SQL query to find games (https://vborg.vbsupport.ru/showthread.php?t=123868)

utw-Mephisto 08-13-2006 05:54 PM

SQL query to find games
 
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 :D )

MrZeropage 08-14-2006 07:56 PM

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

utw-Mephisto 08-14-2006 08:39 PM

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 ..

MrZeropage 08-14-2006 08:52 PM

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



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

utw-Mephisto 08-14-2006 08:58 PM

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 ?

MrZeropage 08-14-2006 09:05 PM

open the "delete"-link in a new tab/browser ;)

utw-Mephisto 08-14-2006 09:09 PM

Yeah - I just thought outside the box myself LOL :D

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

MrZeropage 08-15-2006 06:16 AM

oh ok :D

you are right: gcount !

sorry, timesplayed is userinformation...

utw-Mephisto 08-15-2006 04:31 PM

Deleting about 830 by hand is quite ?tzend ... only 231 to go :(


All times are GMT. The time now is 10:28 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01431 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete