best way to lock rows in MySQL?
| From: | Vince LaMonica | Date: | Thu, 21 Sep 2000 22:53:42 +0000 |
| Subject: | best way to lock rows in MySQL? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3046@lists.php.net to get a copy of this message | ||
Hi all,
I'm developing an app that will enable certain users to edit
records. These records will be derived from multiple tables [using joins
in one to many and many to many relationships]. I would like to only have
one user be able to edit *one* record at a time.
This is for a teacher's grade keeping application, so I have such tables
as a 'student' table, a 'score' table, 'class' table, etc [leaving out
the
tables relating to the joins]. So if a class is being edited, I would like
to lock the particular class so that other users won't have edit privs. I
do not want to lock the entire class table [nor do i want to lock the
entire student table, as students in the class being edited may be in
other classes that need to have grades entered].
With MySQL 3.23.22 there is no row locking - just table locking. So I'm
trying to figure out the most efficiant way to 'lock' records via php4.0.2
[on linux]. Creating a locks table is one way, but I'm looking for more
ideas and/or if there's something that's already proven to be very
efficiant and secure.
TIA,
/vjl/