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,421
    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
    Could someone make a database query to make a new sampler?
     
  3. fro

    fro Member

    Joined:
    Nov 11, 2010
    Messages:
    111
    #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:
    984
    Code:
    DELETE FROM player_depotitems WHERE itemtype = 2517 AND player_id =
     
  5. Darkhaos

    Darkhaos (:

    Joined:
    Apr 17, 2008
    Messages:
    1,922
    [sql]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); [/sql]
     
  6. Bosphorus

    Bosphorus New Member

    Joined:
    Oct 15, 2010
    Messages:
    139
    If help anyone.

    RESET LEVEL - Reset all players to level 8.
    Code:
    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;
    
    RESET PREMMYDAYS and WARNINGS
    Code:
    UPDATE accounts SET premdays = 0, warnings = 0;
    
    RESET PLAYERS SKILLS
    Code:
    UPDATE player_skills SET value = 10, count = 10;
    
    REMOVE MONEY AND QUEST ITENS (GLOBAL) - Depot, Players and Houses - Execute one by one.
    Code:
    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)
    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)
    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)
    
     
  7. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,421
    How can I delete X item of all players with vocation = 0 ?
     
  8. Bonno

    Bonno New Member

    Joined:
    Feb 25, 2011
    Messages:
    1
    Great :D !!
     
  9. Axelor

    Axelor Member

    Joined:
    Sep 2, 2010
    Messages:
    451
    possibl to add 10cc to everyone's account?
     
  10. loza

    loza Oldschool

    Joined:
    Oct 23, 2008
    Messages:
    525
    nice nice that's help alot of people :]
    thank you
     
  11. ADMShadow

    ADMShadow New Member

    Joined:
    Mar 3, 2011
    Messages:
    23
    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
    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:
    5,930
    I'm having SQL on school. :p So I made a sample:

    Code:
    select player_id, count(player_id) as Deaths
    from player_deaths
    group by player_id
    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,368
    [sql]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;[/sql]
     
  15. Znote

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

    Joined:
    Feb 14, 2008
    Messages:
    5,930
    Thank you. :D
     
  16. Gabriel Tibiano

    Gabriel Tibiano Member

    Joined:
    Nov 21, 2009
    Messages:
    421
    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
  18. lucasfg

    lucasfg Member

    Joined:
    May 3, 2009
    Messages:
    88
    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
    Throw your computer from the window... :D
     
  20. Crolly

    Crolly Lithera♣ Dev

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

Share This Page