If this user_id exists in the data table in laravel, other fields under this id are updated. if this field does not exist, a new record is created. how can we implement database operations? Every time I write a resQueryDB: update (& quot; replace1_dog_apple_device... if this user_id exists in the data table in laravel, other fields under this id are updated. if this field does not exist, a new record is created. how can we implement database operations? Every time I write an update, no matter whether the user_id exists or not
$ ResQuery = DB: update ("replaceDog_apple_devices
(User_id
,Apple_token
,Apple_adid
,Created_at
) VALUES ('$ user_id', '$ apple_token', '$ apple_adid', now ())");
Reply content:
If this user_id exists in the data table in laravel, other fields under this id are updated. if this field does not exist, a new record is created. how can we implement database operations? Every time I write an update, no matter whether the user_id exists or not
$ ResQuery = DB: update ("replaceDog_apple_devices(User_id,Apple_token,Apple_adid,Created_at) VALUES ('$ user_id', '$ apple_token', '$ apple_adid', now ())");