How do I read this text file and Insert into MySQL?

前端 未结 5 712
萌比男神i
萌比男神i 2020-12-18 16:07

sample

user id  User Name
   U456      Mathew 
   U457      Leon
   U458      Cris
   U459      Yancy
   U460      Jane

and so on up to 500

5条回答
  •  我在风中等你
    2020-12-18 17:00

    Use the fopen function of PHP to access and read the file.. From there on the rest is pretty much simple. Read the file line by line and insert the values into the database.

    http://us3.php.net/manual/en/function.fopen.php

    The above link gives a very good description of how the fopen function works.. Using a loop will be easy in this task.

提交回复
热议问题