I'm new to mysql and I'm trying to convert this routine that is written for sql server to mysql. This routine updates a record if it exists and adds a record if it does not exists. If anybody can help, please do so. Thanks in advance for your time.
-- update if already exist
IF (@pk_ID <> 0 AND ( EXISTS (SELECT * FROM table1 WHERE pk_ID=@pk_ID)) )
UPDATE table1 SET
INSERT INTO table1