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
Share on other sites

Better idea is dont delete any data related to user, If u know some thing about data warehousing.

Other just put a field in user table and make it active when admin is going to delete the record.

Dont delete the record completely.

Link to comment
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
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
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.