Both your PHP and your MySQL syntax have problems. First, your SQL statement needs to be surrounded by quotes. Secondly, the syntax for LOAD DATA INFILE
is incorrect. Try this:
$stmt=$db->prepare("LOAD DATA INFILE 'insert.txt' into table `Info`");
$stmt->execute();
See the MySQL docs for LOAD DATA INFILE
for more options. You’ll probably need to specify your field and line delimiters, for instance. If you need to set a column to the value of the now()
function, you can issue a separate update
query for that.
0
solved SQL INSERT VALUES INTO TABLE FROM FILE [closed]