Jump to content

Logic Based on prior inserts


Xtremer360

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.