PHP jika ada di bidang database, jika ada pembaruan, jika tidak buat

INSERT INTO <table> (field1, field2, field3, ...) 
VALUES ('value1', 'value2','value3', ...)
ON DUPLICATE KEY UPDATE
field1='value1', field2='value2', field3='value3', ...
Encouraging Emu