Jump to content

user registration, mysql failsafe


benjaminbeazy

Recommended Posts

I'm trying to finish off a user registration system but when I do the MySQL inserts on as many as 3 different tables, I need a failsafe where it only inserts into all 3 and if 1 fails not to insert anything in any of them.

 

For example:

 

query 1 worked

 

query 2 worked

 

query 3 failed

 

so remove inserted rows from all 3 queries

 

not sure, I would like it if there's a way to not insert anything without it first making sure all 3 will work

 

any suggestions??

 

p.s. also not sure if this should be in mysql or php help

 

Link to comment
https://forums.phpfreaks.com/topic/40799-user-registration-mysql-failsafe/
Share on other sites

Unfortunately there is not, using the default myisam tables.  Unless you switch to another table format which supports transactions, the best you can do is to clean up afterwards when something goes wrong.

 

http://dev.mysql.com/books/mysqlpress/mysql-tutorial/ch10.html

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.