|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-16 22:22 UTC] leng at haier dot com
Hi,phpers,
Thank you all for your moil.
I have a txt file,and I wanna load the data from the file to my database,so I write the sentences following.But I found that the last sentence did not fetch anything, the table that named maindata is null.
Why?
////////////////////////////////////////////////////////////
mysql_connect("localhost", "admin", "") ;
mysql_query("DROP DATABASE IF EXISTS stage");
mysql_query("CREATE DATABASE stage");
mysql_query("USE stage");
mysql_query("CREATE TABLE maindata (id VARCHAR(14), materiel VARCHAR(20), counts INT(8))");
mysql_query("LOAD DATA LOCAL INFILE 'Z_P.txt' INTO TABLE maindata");
////////////////////////////////////////////////////////////
kanaka,2002-01-17
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 08:00:01 2025 UTC |
Oh,sorry, I have just found the answer, it was my wrong syntax. The correct syntax is, mysql_query("LOAD DATA LOCAL INFILE 'd:/data/data.txt' INTO TABLE maindata"); Thanks. kanaka 2002-01-17