Jump to content

transactions


jagguy

Recommended Posts

I have a program for 15-20 users and 1 admin guy to override everything.

The program is on the web and accesses a mysql db.

Now what happens with php transactions  as I heard it does something automatically in terms of locking on a mysql db.

 

The users cant delete anything or update any existing data but just add.

The only problem i can see is that if the admin decides to delete a user and associated records must be deleted from other tables. Now do I need to lock the tables to do this so they cant be used while this is being done?

 

 

Link to comment
https://forums.phpfreaks.com/topic/58040-transactions/
Share on other sites

In mysql you can add cascade on deletes and with innodb you can lock records.

 

I want to delete users from my system . Each user has record on Password table and messages in Message table with their login to identitfy them.

To delete all this I was thinking of just setting a flag in the table to say 'deleted' and not physically do it.

 

Then to delete the records physically I wasnt sure whther to use a lock somehow and delete from php using a script or cascades on deletes with just mysql?

 

what can i do?

Link to comment
https://forums.phpfreaks.com/topic/58040-transactions/#findComment-288568
Share on other sites

I am rdoing this question as it is a little old.

I don't know how I am going to delete records from my mysql db. I am using php with mysql.

 

I want to delete a user from my system (from a 'user' table)and I just set a field to say 'deleted'.

I want to physically delete all these records but I don't know if i need to lock tables through innodb or use cascade deletes? I dont know how to lock through innodb either.

 

The 'user record' is on 1 table and has FK's on 2 other tables all related. Also I have 1 table with 1 PK with an auto field because the 4 fields were not unique and this seemed easier.

Link to comment
https://forums.phpfreaks.com/topic/58040-transactions/#findComment-289508
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.