RE: [PHP-DB] Spot the deliberate mistake...
| From: | Mark Benson | Date: | Thu, 16 Dec 2004 17:28:38 +0000 |
| Subject: | RE: [PHP-DB] Spot the deliberate mistake... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37720@lists.php.net to get a copy of this message | ||
On Thursday, December 16, 2004, at 05:21PM, Norland, Martin <Martin.Norland@STJUDE.ORG> wrote:
>"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;"
>
>It's implicit that you use the same data regardless, you're saying "if
>it's already there, just do an update statement with the data already
>provided".
If I try that it returns:
You have an error in your SQL syntax near 'ON DUPLICATE KEY UPDATE' at line 1
so I guess something doesn't work there. I also tried it with and without the line ending and
it didn't work either way :).
--
Mark Benson
http://homepage.mac.com/markbenson