Friday 15 January 2010

Multiple insert in mysql table, some of which may be repeated -



Multiple insert in mysql table, some of which may be repeated -

i'm developing php script in insert multiple info mysql table, of info may inserted. can seek insert each of individual info , observe #1062 error (duplicate entry), inefficient since can more 100 entries. so, there way in 1 query or must utilize query each entry inserted?

thanks lot.

you'll want utilize insert ... on duplicate key update command accomplish this. in "on duplicate key update" section, can kind of update changes nothing. example, "set fieldname=fieldname", nil changed.

http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html

mysql sql-insert

No comments:

Post a Comment