I am on my way to migrate to another dbms too. Can somebody give me direction please ? How can we write replacement for mysql statement:
REPLACE INTO $table ($fields) VALUES ($values)
1. A Series of delete and insert:
DELETE from $table WHERE ...
INSERT INTO $table ($fields) values ($values) WHERE ...
2. Or doing the hard way with UPDATE:
SET field1 = $value1, field2 = $value2, field3=$value3
WHERE primarykey_field = $primarykeyvalue
In both alternatives I found that me must know the primary key field and it's value. How can we possibly do it inside dbSave($table,$fields,$values) function ?