Spot the deliberate mistake...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following SQL statement returns an error. What is wrong with it? The error is stated as being near 'ON DUPLICATE KEY UPDATE foo_no='$data[1]', alt_no='$data[2]', descript='$data[3]', pr'

"INSERT INTO `foobar2` SET part_no='$data[0]', foo_no='$data[1]', alt_no='$data[2]', descript='$data[3]', price='$data[4]', unit_sale='$data[5]', unit_issue='$data[6]', weight='$data[7]', brand='$data[8]', nla_tag='0' ON DUPLICATE KEY UPDATE foo_no='$data[1]', alt_no='$data[2]', descript='$data[3]', price='$data[4]', unit_sale='$data[5]', unit_issue='$data[6]', weight='$data[7]', brand='$data[8]', nla_tag='0'"

This is passed in a PHP script so the line ending ';' is not present.

I'm getting better at writing SQL statements but sometimes it just throws me a total curved ball!

-- 
Mark Benson

http://homepage.mac.com/markbenson

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux