0

I've this code to load data from text file into MySQL table. but I don't know why it is not working.

My php code:

self::$mysqliStmts=DBCon::ConnectToDB();
self::$data=DBCon::QueryDataWithoutProcessing("LOAD DATA INFILE 'C:\wamp\www\php\gagster\Others\friends.txt' INTO TABLE gagster.friends");      
mysqli_close(self::$mysqliStmts);

public static function QueryDataWithoutProcessing($query)
{
    self::ConnectToDB();
    self::$QueryResult=self::$mysqli->query("$query");      //process query
    mysqli_close(self::$mysqli);                            //close connection
    return self::$QueryResult;                              //return result 
}

When I write any other query in place of this query it works fine.Only this query is causing problems.

I ran the query in mysql workbench and there also it is working fine.

1 Answer 1

3

"Windows path names are specified using forward slashes rather than backslashes. If you do use backslashes, you must double them." - http://dev.mysql.com/doc/refman/5.1/en/load-data.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.