INSERT INTO requests ('user_id','subject','text','time')
VALUES (56,'test','test 1234',6516516)
ON DUPLICATE KEY UPDATE time = VALUES(time), user_id = VALUES(user_id)
Have the relevant columns set to index UNIQUE.
This will insert a row, but if subject or text (or both) already exist, you instead update the existing row with given time
and user_id
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…