Insert new user record / update user record

Hi,

Can someone try to provide more php write example for some of the common scenario. Eg in the case of a user set (table)

Since the email address length is long, using a uuid as a key may be logical. Then storing the email, hash and other fields in bins with email set as an index.

When the user sign up, how to only insert the record when no existing record (email) is found in the secondary index. Do we need to first do a query to check if it exists then insert after confirming it does not exists or is there any simpler way to do it.

Next how to update the record of a specific user record without using the PK. (Just by filtering by the email bin value)

Please help to provide sample code in php for the above insert and update. I’ve a hard time trying to find any such code.

Regards, Francis