PHP MySQL LOAD DATA INFILE Help

前端 未结 2 813
既然无缘
既然无缘 2021-01-21 03:13

I just can\'t seem to get this query right. Basically I\'m taking a csv from a form and trying to load it into the database. I took the majority of the query from phpmyadmin. i

2条回答
  •  太阳男子
    2021-01-21 03:47

    You need to escape the slash for the lines terminated clause, otherwise you just added a newline to your query.

    LINES TERMINATED BY '\\n'

    Mysql will just get \n, but PHP tries to interpret those so you have to escape them.

    You may have other issues, but you haven't told us what happens.

提交回复
热议问题