BoneHunter9 Posted April 5, 2013 Share Posted April 5, 2013 First,im a kinda noob with mysql,i know some basics,not more. Thats the reason for my following question: I have a giant .txt file with many user datas in,but now i need all these datas in a sql database. The database contains a table called "Plots" with the following rows: idx ; idz ; owner ; topX ; topZ So the format of the datas in the txt file is that: max: {x: 127.0, y: 200.0, z: 208.0} user: [maximini97] I marked with colors wich data has to be in what row. The row idx and idz just has to be continued in that style: -1;-2 etc I have about 2000 datas to put in,and doing this by hand would be a fulltime job. So i need a sql command or a script for this. I would be very happy when someone can help me with this Greetings Bone Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/ Share on other sites More sharing options...
Jessica Posted April 5, 2013 Share Posted April 5, 2013 You'll need to write a script using something like PHP. If you need someone to do it for you, post in Freelance. Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/#findComment-1423090 Share on other sites More sharing options...
BoneHunter9 Posted April 5, 2013 Author Share Posted April 5, 2013 (edited) I figured out that i need a script,so i hoped to find someone here who can help me out with that. And this needs only to do 1 time,after that i dont need the txt file anymore :S So setting up a freelance announcement is mabye to mutch Edited April 5, 2013 by BoneHunter9 Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/#findComment-1423092 Share on other sites More sharing options...
Jessica Posted April 5, 2013 Share Posted April 5, 2013 (edited) We will help you with code YOU write, or you can hire someone to do it for you. What have you done so far? Cause so far you're saying "help me out" but it's looking like "do it for me". Edited April 5, 2013 by Jessica Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/#findComment-1423094 Share on other sites More sharing options...
BoneHunter9 Posted April 5, 2013 Author Share Posted April 5, 2013 "do it for me". I said im a sql noob,im more into server management than scripting. So it is more a script request than a help request. Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/#findComment-1423098 Share on other sites More sharing options...
Jessica Posted April 5, 2013 Share Posted April 5, 2013 If you need someone to do it for you, post in Freelance. Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/#findComment-1423134 Share on other sites More sharing options...
Christian F. Posted April 5, 2013 Share Posted April 5, 2013 (edited) If you want to have a crack at this yourself, then you need to read up on a bit of stuff. Firstly, start with basic PHP syntax, if you haven't done so already. Then, move on to the next chapters of the PHP manual, skipping the installation one (as PHP is installed already). I recommend reading everything up to the function reference, which you'll be using as a... Well, reference, later on. Once you've done that, you'll want to find a MySQL + PHP tutorial, which there are many of. Just take care to preferably find one that is using MySQLI or PDO, since the others are out of date by now. Follow it, to get a basic understand of how SQL works. Also, remember to read up on SQL injections, and how to protect you against them. Hint: Prepared statements. The next step is to read up on JSON, and how to decode JSON in PHP. Along with reading files, and that should be all of the basic functionality you need. Good luck! Edited April 5, 2013 by Christian F. Quote Link to comment https://forums.phpfreaks.com/topic/276576-importing-txt-files-into-a-database/#findComment-1423144 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.