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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 12:01:30 2024 UTC