Thread: MySQL : Player Loading / Saving - Creating a Query

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 MySQL : Player Loading / Saving - Creating a Query 
    Registered Member
    Join Date
    Jun 2016
    Posts
    52
    Thanks given
    5
    Thanks received
    0
    Rep Power
    11
    As the title states , I'm currently trying to figure out how create a query for a MYSQL database that would hold all the data I need to Save players and Load players from the MYSQL Database.

    This is what I tried ,
    http://pastebin.com/RL9pPmNC

    which doesn't do what I need rather than making it label each character file it just labels account with the same values over and over.
    Can anyone be of assistance? or just kind of explain something's to me?

    discord : itsR34#1868
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jun 2012
    Age
    28
    Posts
    373
    Thanks given
    15
    Thanks received
    185
    Rep Power
    0
    Quote Originally Posted by ItsR34 View Post
    As the title states , I'm currently trying to figure out how create a query for a MYSQL database that would hold all the data I need to Save players and Load players from the MYSQL Database.

    This is what I tried ,
    http://pastebin.com/RL9pPmNC

    which doesn't do what I need rather than making it label each character file it just labels account with the same values over and over.
    Can anyone be of assistance? or just kind of explain something's to me?

    discord : itsR34#1868
    You shouldn't be doing it like that.

    Allow me to show you how my table looks, then you can change the fields to how your server looks.

    For my example.. I'm loading the actual password / salt / username from my MyBB forum.. So you'll have to write up some sort of check for the actual information:

    https://paste.ee/p/EnGAF

    ^ character saves,

    https://paste.ee/p/lmG3j

    ^ Character's stats saving

    And here's a little treat, I did all the data of items, npcs, spawns and logging in a database as well..

    So here is the npc spawns table:

    https://paste.ee/p/SUQXu

    You shouldn't be inserting a mass query to make a table. Make the table first THEN fill it with the needed data.
    Of course, you'll need to write the server sided logic for these examples, But i gave you an excellent start.
    Reply With Quote  
     

  3. #3  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by Logan View Post
    You shouldn't be doing it like that.

    Allow me to show you how my table looks, then you can change the fields to how your server looks.

    For my example.. I'm loading the actual password / salt / username from my MyBB forum.. So you'll have to write up some sort of check for the actual information:

    https://paste.ee/p/EnGAF

    ^ character saves,

    https://paste.ee/p/lmG3j

    ^ Character's stats saving

    And here's a little treat, I did all the data of items, npcs, spawns and logging in a database as well..

    So here is the npc spawns table:

    https://paste.ee/p/SUQXu

    You shouldn't be inserting a mass query to make a table. Make the table first THEN fill it with the needed data.
    Of course, you'll need to write the server sided logic for these examples, But i gave you an excellent start.
    skills table should be one to many ie something like id, player_id, skill, level, xp
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    May 2016
    Age
    26
    Posts
    281
    Thanks given
    162
    Thanks received
    64
    Rep Power
    96
    Quote Originally Posted by Stuart View Post
    skills table should be one to many ie something like id, player_id, skill, level, xp
    Would it not depend on how you plan to use the info in the database(s)?
    Reply With Quote  
     

  5. #5  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by Brandito View Post
    Would it not depend on how you plan to use the info in the database(s)?
    not really, depends on the data structure a skill has many of the same thing so it would be one(player) to many(skills) same for items etc
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    May 2016
    Age
    26
    Posts
    281
    Thanks given
    162
    Thanks received
    64
    Rep Power
    96
    Can I ask why you want to save & load from MySQL to begin with?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jun 2016
    Posts
    52
    Thanks given
    5
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Brandito View Post
    Can I ask why you want to save & load from MySQL to begin with?
    In the long run , forum / web integration will be easier wouldnt it?
    I have plans on doing things with the SQL databases in the long run for my future project.

    Quote Originally Posted by Logan View Post
    You shouldn't be doing it like that.

    Allow me to show you how my table looks, then you can change the fields to how your server looks.

    For my example.. I'm loading the actual password / salt / username from my MyBB forum.. So you'll have to write up some sort of check for the actual information:

    https://paste.ee/p/EnGAF

    ^ character saves,

    https://paste.ee/p/lmG3j

    ^ Character's stats saving

    And here's a little treat, I did all the data of items, npcs, spawns and logging in a database as well..

    So here is the npc spawns table:

    https://paste.ee/p/SUQXu

    You shouldn't be inserting a mass query to make a table. Make the table first THEN fill it with the needed data.
    Of course, you'll need to write the server sided logic for these examples, But i gave you an excellent start.
    can you explain these parts?
    Code:
    int(11) NOT NULL DEFAULT '0',
    whats the difference between int , varchar , tinyint , smallint , longtext , etc
    some of them are self explanatory for sure but some of them i wonder why you use certain ones instead of others.


    Quote Originally Posted by Stuart View Post
    skills table should be one to many ie something like id, player_id, skill, level, xp
    originally i sent you a PM asking for help on this , as id seen your posts on it.
    but you never got back to me.. must be that rep life..
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Oct 2009
    Posts
    438
    Thanks given
    29
    Thanks received
    108
    Rep Power
    0
    Quote Originally Posted by ItsR34 View Post
    whats the difference between int , varchar , tinyint , smallint , longtext , etc
    some of them are self explanatory for sure but some of them i wonder why you use certain ones instead of others.
    http://www.peachpit.com/articles/art...30885&seqNum=7
    Give that a good read and it should start a good foundation for understanding the difference in data types.

    Quote Originally Posted by ItsR34 View Post
    can you explain these parts?
    Code:
    int(11) NOT NULL DEFAULT '0',
    int(11) means that the column can store maximum int value of 11, whereas, NOT NULL means that it must always contain a value.
    Reply With Quote  
     

  9. #9  
    ???

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,612
    Thanks given
    255
    Thanks received
    989
    Rep Power
    1366
    Quote Originally Posted by x_stormrider View Post
    http://www.peachpit.com/articles/art...30885&seqNum=7
    Give that a good read and it should start a good foundation for understanding the difference in data types.


    int(11) means that the column can store maximum int value of 11, whereas, NOT NULL means that it must always contain a value.
    no the amount of digits is 11 not the maximum value (incl - i believe) int is 4 bytes no matter what or else it's not an int
    .
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    May 2016
    Age
    26
    Posts
    281
    Thanks given
    162
    Thanks received
    64
    Rep Power
    96
    Quote Originally Posted by ItsR34 View Post
    In the long run , forum / web integration will be easier wouldnt it?
    I have plans on doing things with the SQL databases in the long run for my future project.



    ...
    Well, add my skype (brandon_dtd) and I'll show you how I integrated player data into the website.
    Basically only save the things you need to save to MySQL, on my websites I let players view stuff like their total donations, points (pk, vote, donator) and also let players change data like their unlock pin, email address, password (and display name for servers that have that) and loyalty titles if you want to go all out fancy and have them shown before/after the username. Obviously though, before putting passwords anywhere near MySQL, hash them server-sided, not encrypt, hash.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI]Better Player Loading/Saving
    By Slawth Baws in forum Snippets
    Replies: 27
    Last Post: 02-20-2013, 03:23 AM
  2. [PI]Better Player Loading/Saving
    By Slawth Baws in forum Snippets
    Replies: 3
    Last Post: 02-15-2013, 12:26 AM
  3. [Hyperion] MySQL Character Loading/Saving
    By Joshua F in forum Snippets
    Replies: 6
    Last Post: 12-03-2012, 01:52 AM
  4. [562][rs2hd] MySQL Player Saving & Loading [REQ]
    By coolv1994 in forum Requests
    Replies: 11
    Last Post: 09-11-2011, 01:36 AM
  5. [DELTA] mySQL Player loading
    By nl pk3er in forum Help
    Replies: 2
    Last Post: 04-25-2010, 01:43 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •