Member Avatar for kirtan_thakkar

I have a database in a text file. I want to add the database from it to my MySQL database. I am new to php so i want the code of it and please explain if you can because it will help to increase my php knowledge. And after adding 1 line into database i want to skip 2 lines.. Can any one help me..??

Recommended Answers

All 4 Replies

load data infile "filename.txt" into table tablename fields terminated by ","

You can run above query for that.

mysql_query("LOAD DATA LOCAL INFILE '/path/to/file' INTO TABLE mytable");

try this code....

cheers

when you say run this querry, where do you run it? in mysql or you querry it on the connect.php file?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.