php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15077 mysql_query("LOAD DATA LOCAL INFILE 'd:\\txt\\data.txt' INTO TABLE maindata")
Submitted: 2002-01-16 22:22 UTC Modified: 2002-01-16 23:05 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: leng at haier dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.1.1 OS: Windows2000 Professornal
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: leng at haier dot com
New email:
PHP Version: OS:

 

 [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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-16 23:03 UTC] leng at haier dot com
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
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 10 23:01:29 2025 UTC