Jump to content

[SOLVED] insert record to MySQL if the record is NOT in the database else update


mrprozac

Recommended Posts

Hi,

 

I'm writing a search script for my website and want to count the searches, i want to use MySQL for that.

 

I want to insert the search query to MySQL and update the count value.

 

Example.

If 'query1' is not found in the database insert 'query1' in the database, if 'query1' is already present in the database, update the count value with +1 (value + 1)

 

Could someone help me with a script to perform this?

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.