Welcome Guest, Not a member yet? Register   Sign In
How upload data example.txt into database
#1

[eluser]Unknown[/eluser]
I HAVE DATA EXAMPLE.TXT LIKE THIS BELOW NAME OF DATA IS EXAMPLE.TXT , HOW TO UPLOAD INTO DATABASE MYSQL , THANKS

511456212222 AHMAD
511456212223 FARID
511456212224 FAJAR
511456212225 HAMID
511456212226 FAIZ
#2

[eluser]Dennis Rasmussen[/eluser]
Documentation you need: http://dev.mysql.com/doc/refman/5.1/en/load-data.html

1. Upload TXT file to your webroot
2. Setup your table in your database (make sure it has the same amount of fields as the data in your txt file)
3. Run the following Query:

Code:
$this->db->query("LOAD DATA INFILE 'example.txt' INTO TABLE table_name FIELDS TERMINATED BY ' '");




Theme © iAndrew 2016 - Forum software by © MyBB