Sunday 12 November 2017

mysql - #1054 - Unknown column 'name' in 'field list'

I have this
XML:





3
myname
67
$34.00



I
also have a mysql
table:




+-----------+--------+-------------+
|
ID | Title | Price |
+-----------+--------+-------------+
| 1 |
title1 | $19.00 |
| 2 | title2 | $24.00
|
+-----------+--------+-------------+


I'm
trying to insert the xml file into the table with this
code:




LOAD XML LOCAL
INFILE 'pathtothefile/filename.xml'
INTO TABLE mytable
ROWS
IDENTIFIED BY ''
SET ID = id, Title=name,
Price=price;


But I get
this error #1054 - Unknown column 'name' in 'field list'

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...