Jump to content

[SOLVED] UPDATE or INSERT


SetToLoki

Recommended Posts

I have some data in a php array and I want to insert the data from this array into several tables.

 

now my problem is that some of the data will allready be entered into the databse and if it is I want to update it. if it isn't there I need to add it.

 

is there an sql query that would help me do this efficently

 

Link to comment
https://forums.phpfreaks.com/topic/74211-solved-update-or-insert/
Share on other sites

Also a possible more accurate thing of what you describe you want is this bit.

 

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

 

Maybe there is a better way to do what you want al together if you give more details on what you are working on.

Also a possible more accurate thing of what you describe you want is this bit.

 

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

 

Maybe there is a better way to do what you want al together if you give more details on what you are working on.

If appropriate, this is better, since REPLACE does an implicit DELETE.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.