PHP [phpMyAdmin] Commands to edit database.

Discussion in 'Programming & Scripting' started by Jester, Jun 23, 2008.

  1. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    What command I have to use to:

    DELETE ALL ITEMS FROM DEPOT
    DELETE ALL PLAYERS ITEMS

    -- EDIT --

    Forget it ;]
     
  2. Trix23

    Trix23 New Member

    Joined:
    Feb 1, 2009
    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Could someone make a database query to make a new sampler?
     
  3. fro

    fro Member

    Joined:
    Nov 11, 2010
    Messages:
    111
    Likes Received:
    1
    Best Answers:
    0
    #1064 - 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 'WHERE itemtype = 2517' at line 1

    when using =

    DELETE FROM player_depotitems, player_items, tile_items WHERE itemtype = 2517

    btw, is there any special command to delete items from a specific character ?
     
  4. SpiderOT

    SpiderOT ™ツʂριԃҽɾσƚ➽ ٩(•‿•)۶★彡

    Joined:
    Sep 29, 2008
    Messages:
    985
    Likes Received:
    80
    Best Answers:
    1
    Code (Text):
    1. DELETE FROM player_depotitems WHERE itemtype = 2517 AND player_id =
     
  5. Darkhaos

    Darkhaos (:

    Joined:
    Apr 17, 2008
    Messages:
    1,922
    Likes Received:
    170
    Best Answers:
    0
    Code (SQL):
    1. INSERT INTO `players` VALUES (NULL, 'Noob Sampler', 1, 1, 1, 0, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 10, 10, 10, 0, 0);  
     
  6. Bosphorus

    Bosphorus New Member

    Joined:
    Oct 15, 2010
    Messages:
    139
    Likes Received:
    10
    Best Answers:
    0
    If help anyone.

    RESET LEVEL - Reset all players to level 8.
    Code (Text):
    1.  
    2. UPDATE players SET level = 8, health = 185, healthmax = 185, experience = 4200, lookaddons = 0, mana = 35, manamax = 35, manaspent = 0, soul = 0, town_id = 5, posx = 32369, posy = 32241, posz = 7, cap = 470, sex = 0, lastlogin = 0, lastip = 0, skull = 0, skulltime = 0, rank_id = 0, guildnick = '', lastlogout = 0, blessings = 0, balance = 0, stamina = 151200000, loss_experience = 100, loss_mana = 100, loss_skills = 100, loss_containers = 100, loss_items = 100, premend = 0, online = 0, marriage = 0, promotion = 0, deleted = 0, created = 0, hide_char = 0, comment = '', exphist_lastexp = 4200, exphist1 = 0, exphist2 = 0, exphist3 = 0, exphist4 = 0, exphist5 = 0, exphist6 = 0, exphist7 = 0, onlinetimetoday = 0, onlinetime1 = 0, onlinetime2 = 0, onlinetime3 = 0, onlinetime4 = 0, onlinetime5 = 0, onlinetime6 = 0, onlinetime7 = 0, onlinetimeall = 0, auction_balance = 0;
    3.  
    RESET PREMMYDAYS and WARNINGS
    Code (Text):
    1.  
    2. UPDATE accounts SET premdays = 0, warnings = 0;
    3.  
    RESET PLAYERS SKILLS
    Code (Text):
    1.  
    2. UPDATE player_skills SET value = 10, count = 10;
    3.  
    REMOVE MONEY AND QUEST ITENS (GLOBAL) - Depot, Players and Houses - Execute one by one.
    Code (Text):
    1.  
    2. DELETE FROM `player_depotitems` WHERE  `itemtype` IN (2160, 2453, 6528, 8851, 8909, 8908, 8907, 8906, 8905, 2493, 2361, 8888, 8882, 8883, 8881, 2495, 8918, 10021, 6132, 2640, 2494, 2471, 7429, 7434, 7390, 7384, 7389, 7415, 7406, 7380, 7392, 8890, 8928, 8924, 8930, 8854)
    3. DELETE FROM `player_items` WHERE `itemtype` IN (2160, 2453, 6528, 8851, 8909, 8908, 8907, 8906, 8905, 2493, 2361, 8888, 8882, 8883, 8881, 2495, 8918, 10021, 6132, 2640, 2494, 2471, 7429, 7434, 7390, 7384, 7389, 7415, 7406, 7380, 7392, 8890, 8928, 8924, 8930, 8854)
    4. DELETE FROM `tile_items` WHERE `itemtype` IN (2160, 2453, 6528, 8851, 8909, 8908, 8907, 8906, 8905, 2493, 2361, 8888, 8882, 8883, 8881, 2495, 8918, 10021, 6132, 2640, 2494, 2471, 7429, 7434, 7390, 7384, 7389, 7415, 7406, 7380, 7392, 8890, 8928, 8924, 8930, 8854)
    5.  
     
  7. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    How can I delete X item of all players with vocation = 0 ?
     
  8. Bonno

    Bonno New Member

    Joined:
    Feb 25, 2011
    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Great :D !!
     
  9. Axelor

    Axelor Member

    Joined:
    Sep 2, 2010
    Messages:
    481
    Likes Received:
    9
    Best Answers:
    0
    possibl to add 10cc to everyone's account?
     
  10. loza

    loza Oldschool

    Joined:
    Oct 23, 2008
    Messages:
    525
    Likes Received:
    6
    Best Answers:
    0
    nice nice that's help alot of people :]
    thank you
     
  11. ADMShadow

    ADMShadow New Member

    Joined:
    Mar 3, 2011
    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Someone can help me please?
    --
    mysql_real_query<> : SELECT `name` , `password` , `salt`, `premdays` , `lastday`, `key`, `warnings`
    FROM `accounts` WHERE `id` = 1 LIMIT 1 - MYSQL ERROR : Unknown column 'salt' in 'field list' <1054>
    --
    I use TFS 0.4 and Mysql!
     
  12. Gabriel Tibiano

    Gabriel Tibiano Member

    Joined:
    Nov 21, 2009
    Messages:
    421
    Likes Received:
    4
    Best Answers:
    0
    why u're bumping old thread?
    x.o
     
  13. Znote

    Znote <?php echo $title; ?> Staff Member Global Moderator Premium User

    Joined:
    Feb 14, 2008
    Messages:
    6,204
    Likes Received:
    940
    Best Answers:
    109
    I'm having SQL on school. :p So I made a sample:

    Code (Text):
    1. select player_id, count(player_id) as Deaths
    2. from player_deaths
    3. group by player_id
    4. order by count(player_id) desc
    This will show a highscore of which player_id (can resemble character) have died the most.

    It is a query from the player_deaths table. But how can I use the player_id to fetch the proper character name from the players table??? D:
     
  14. Mark

    Mark Administrator Staff Member Administrator

    Joined:
    May 27, 2007
    Messages:
    6,376
    Likes Received:
    1,328
    Best Answers:
    19
    Code (SQL):
    1. SELECT `player_id`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `name`, COUNT(`player_id`) AS `Deaths` FROM `player_deaths` GROUP BY `player_id` ORDER BY COUNT(`player_id`) DESC;
     
  15. Znote

    Znote <?php echo $title; ?> Staff Member Global Moderator Premium User

    Joined:
    Feb 14, 2008
    Messages:
    6,204
    Likes Received:
    940
    Best Answers:
    109
    Thank you. :D
     
  16. Gabriel Tibiano

    Gabriel Tibiano Member

    Joined:
    Nov 21, 2009
    Messages:
    421
    Likes Received:
    4
    Best Answers:
    0
    Anyone could make me an code to set a new field near 'location' called "Address" ?
     
  17. Gabriel Tibiano

    Gabriel Tibiano Member

    Joined:
    Nov 21, 2009
    Messages:
    421
    Likes Received:
    4
    Best Answers:
    0
  18. lucasfg

    lucasfg Member

    Joined:
    May 3, 2009
    Messages:
    88
    Likes Received:
    2
    Best Answers:
    0
    what is the best way to delet all players and accs from my database?
     
  19. abes800

    abes800 Experienced Member

    Joined:
    Sep 3, 2010
    Messages:
    2,035
    Likes Received:
    137
    Best Answers:
    0
    Throw your computer from the window... :D
     
  20. Crolly

    Crolly Lithera♣ Dev

    Joined:
    Dec 6, 2011
    Messages:
    490
    Likes Received:
    4
    Best Answers:
    0
    Probably to create a new database, I'm not too familiar with phpmyadmin, but it's an option atleast.
     

Share This Page

Loading...