Jump to content

Check for duplicate database entries and add to them or create new ones


spinner0205

Recommended Posts

I have a PHP script that inserts data to a MySQL database. It may sometimes add entries that correspond with duplicate ones by a certain field. So if the 'username' field is already in the database I want it to add the information to that username entry.

 

For example, bob's data is inserted and there is already a bob username field entry so the field 'balance' under this entry has a balance of 4000 and I want to add 200 to the balance. How would I go about doing this?

 

Also if the username does not exist yet, then obviously have it create a new one.

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.