Hi all.
I have the following query in a php/mysql application:
where the table has a unique index on tag_name and tag_entry_id (combined). i was hoping this would insert three records if none of them already exist, which it does. i was also hoping that if a "bob" record already exists for entry 3, that cory and tim would still be added.
it appears only cory is added, then the error (duplicate) occurs, then it craps out. do you know of any way to accomplish this? i don't want to test for existence, delete, then insert.
*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
I have the following query in a php/mysql application:
Code:
insert tags ( `tag_name`, `tag_entry_id` )
values ( 'cory', 3 ),
( 'bob', 3 ),
( 'tim', 3 )
where the table has a unique index on tag_name and tag_entry_id (combined). i was hoping this would insert three records if none of them already exist, which it does. i was also hoping that if a "bob" record already exists for entry 3, that cory and tim would still be added.
it appears only cory is added, then the error (duplicate) occurs, then it craps out. do you know of any way to accomplish this? i don't want to test for existence, delete, then insert.
*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]