sheeppimpdaddy Posted October 2, 2009 Share Posted October 2, 2009 Hi I'm relatively new to PHP, only really done reverse engineering of code snipets but i've got myself stuck I want to take some game data and insert it into 3 seperate SQL DB's With the ability to cross reference between each DB. The DB's will be Players, Planet, Alliance (I'll work on the interface to link all 3 data blocks after i've learned this and coded the meat of the others) To start i'll try the planets DB. I've uploaded a full system and an empty one to show comparison. I need to target the last blocks of info which start on different lines depending on how many planets are colonized in that system. They start with for example with [12:385:01]. The 12 is galaxy no, the 385 is solar system and the 1 is planet no. There are 14 galaxies with 400 solar system per galaxy and 16 planets per solar system, so a lot of data and manual inputs This block then needs to be input into the DB's in the appropriate places to be recalled at a later date. As the number of planets is fixed i suppose the DB could be set up before hand with the planet list and then added to when the systems are manually input into this script (aint got a clue) the data bits i need: planet location - planet name owner/player name Temp Alliance I guess it would have to be done with an if statement as any planet that is Uninhabited has none of this data and the script might throw a paddy at this bit. If anyone can help it'd be much appreciated I just don't have a clue where to start or how to do it [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/176307-importing-game-info-into-db/ Share on other sites More sharing options...
lemmin Posted October 2, 2009 Share Posted October 2, 2009 Are you asking how to automate the process of taking all that textual data and inserting it into tables in a database? If so, I would suggest using regular expressions to parse your text files and then put insert the data. Depending on what type of information you need about each tier of your planet system, you might want a separate table for planets, galaxies and solar systems. Are you looking for tutorials? Link to comment https://forums.phpfreaks.com/topic/176307-importing-game-info-into-db/#findComment-929223 Share on other sites More sharing options...
sheeppimpdaddy Posted October 2, 2009 Author Share Posted October 2, 2009 Are you asking how to automate the process of taking all that textual data and inserting it into tables in a database? If so, I would suggest using regular expressions to parse your text files and then put insert the data. Depending on what type of information you need about each tier of your planet system, you might want a separate table for planets, galaxies and solar systems. Are you looking for tutorials? Unfortunately I need to paste each system in by hand for the script to place into the DB, any other method would get me banned from the game Basically each planet will have an espionage report which i'd like to link eventually and then each player needs to be linked to both, planets and alliances. But i thought if i could get this working right then i would be able to work the rest out with a little guidance (tis the way i learn by trial and error ) as most of the coding will be similar so easy to change as long as i understand why the code does what it does Because i don't know php that well, i don't know what to look for in tutorials. Even worse I don't even know the function i'd need to target a piece of text and put that in a DB lol. The DB side of things i can research as thats kinda simple to look for i know what it is lol. Link to comment https://forums.phpfreaks.com/topic/176307-importing-game-info-into-db/#findComment-929303 Share on other sites More sharing options...
sheeppimpdaddy Posted October 3, 2009 Author Share Posted October 3, 2009 i've found an easier way to present the data to the script yippee lol I can now go line by line which makes things easier for me, and i've already found a member who had this way explained to them so i kinda got a good idea when i get most of the code done and working i'll post in here to show how i'm getting on Link to comment https://forums.phpfreaks.com/topic/176307-importing-game-info-into-db/#findComment-929584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.