jagguy Posted July 2, 2007 Share Posted July 2, 2007 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? Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 sorry here a full tutoral sorry dont no reading the text as we speek ok. http://www.webmonkey.com/webmonkey/backend/databases/tutorials/tutorial2.html Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted July 2, 2007 Share Posted July 2, 2007 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. Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 hello there i enjoyed that read just read ths one page tell you every think you need to no. http://www.webmonkey.com/webmonkey/02/11/index3a_page5.html?tw=backend Quote Link to comment Share on other sites More sharing options...
jagguy Posted July 3, 2007 Author Share Posted July 3, 2007 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? Quote Link to comment Share on other sites More sharing options...
jagguy Posted July 4, 2007 Author Share Posted July 4, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.