Read a text file and transfer contents to mysql database

后端 未结 4 982
终归单人心
终归单人心 2020-12-15 12:53

I need a php script to read a .txt file.

The content of the text file are like this:

data.txt

145|Joe Blogs|17/03/1954
986|Jim          


        
4条回答
  •  长情又很酷
    2020-12-15 13:51

    $sql = "INSERT INTO data_table (iddata, name, age) VALUES('".$a."','".$b."', **'** ".$c." **'** )";
    

    issue is with the single quotes around $c. There is no single quotes. Add it.

提交回复
热议问题