inserting word from textfile into database


Hi, I’ve some problems which i would like to ask some help with

i wish to have help on storing a specific word from a text file into my database using php

for example:

inside text file
123 janice 20+ 11/06/87

inside database
… … … Age …
… … … 20+ …


If the textfile is consistent with the info in it, you could read the contents into your PHP file using file() or file_get_contents(), use explode() to get the data out of each row into a separate array and then insert it into a database with a query.


thanks for that but do you mind explaining in more details???


For more information on each of those functions, look here

They have a full explanation of all these functions.

If you still have questions, come back and let us know what you are having trouble with.


Thanks for the help there and i’ve tried and understand wats the code is all about

but i would like help on getting a specific line of a text file and then explode it and get the word out.

for example:

321 Janice 20
123 Martin 20
213 Augustine 20
312 Gary 20

and then i’ll just get

123 Martin 20

out and explode it