Welcome Guest, Not a member yet? Register   Sign In
ON DUPLICATE KEY or equivalent
#2

Have you looked into the Query Builder method replace()? (Docs here)

Or, you can include a hidden field to hold the value of the primary key field when updating a record or, for a new record the value is NULL

If ($_POST['your_key_field'] === NULL) then insert, else, update.
Reply


Messages In This Thread
ON DUPLICATE KEY or equivalent - by colin147 - 11-29-2017, 12:54 PM
RE: ON DUPLICATE KEY or equivalent - by dave friend - 11-29-2017, 07:24 PM
RE: ON DUPLICATE KEY or equivalent - by colin147 - 11-30-2017, 03:07 AM
RE: ON DUPLICATE KEY or equivalent - by colin147 - 11-30-2017, 03:44 AM
RE: ON DUPLICATE KEY or equivalent - by keebOo - 12-07-2017, 05:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB