ronnie3148 Posted March 10, 2011 Share Posted March 10, 2011 It will be a txt file and I need to parse it and insert it into a mysql, I know there are many parser examples out there, but half I don't understand...... this is how the file is... I'll also attach it... [5/3/2011 12:37:14]: SuspectsKill: TeK_SiC Pwn^Guandi 9mm SMG I need to place the killer and the person who got killed, I don't really need the weapon if there not in the db I need to enter it..... and if they are I need it to add a kill on there name... this is just some of the log.. thanks for the help! [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted March 10, 2011 Share Posted March 10, 2011 This will become a large project for you. I suggest you read tutorials on how to assign variables and arrays, as well as how to insert/update data into a database. nobody here is going to write it for you, but we will give you guidance on how to get where you need to go. To start yourself off, learn about arrays and how to deal with the database. Quote Link to comment Share on other sites More sharing options...
ronnie3148 Posted March 10, 2011 Author Share Posted March 10, 2011 Well I know all about arrays how to insert into a db... but I just don't get how I can tell php to get only certain areas and skipping some... like skipping the timestamp.. Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted March 10, 2011 Share Posted March 10, 2011 whatever your source is, just identify the values as a variable and insert into your table as such. you can skip any data you don't want as easily as you can input the data you DO want. Quote Link to comment Share on other sites More sharing options...
ronnie3148 Posted March 10, 2011 Author Share Posted March 10, 2011 How do I delimit bye a word in the line? say SuspectsKill I tried $t = explode("SuspectsKill",$line); //assume that a space delimits each piece of data Quote Link to comment 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.