0

I would like to insert data to the DB only if it's not already exist. so I'm using INSERT IGNORE.

The problem is with field "createDate" - it's change every second and that's turn the new data to be new/unique. Is there any way to set the comparison fields for the SQL ?

$res = mysql_query ("INSERT IGNORE INTO `alerts` (userID, type, refID, title, openBy, createDate) VALUES (".$mainIndex['userID'].", 'comment',  ".$mainIndex['id'].", '".$contactName."', ".$mainIndex['userID'].", ".$todayLX.")");
jarlh
  • 42,561
  • 8
  • 45
  • 63
Roi
  • 181
  • 1
  • 1
  • 8

0 Answers0