Jump to content

Recommended Posts

I'm curious to know if someone could explain some logic on how to write a specific function. In my register controller I have a function called create_user. When the function gets called it runs a function in my model called insert user that inserts set data such as username, email address, name, etc. to the users table as a new row. It returns te user_id (auto increment id) back to the create user function then if the user_id is more than one the runs the insert_registration_details model function that inserts user data into the registrations table like the ip address, browser, etc.. If it fails to insert into that table I want it to go back and delete the user in the users table. How can I achieve this if the database user doesn't have delete privileges.

Link to comment
https://forums.phpfreaks.com/topic/267680-logic-based-on-prior-inserts/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.