Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in MySQL only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
MySQL
How to lock selected rows from reading in other session?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
salsan
New Member
Join Date:
Nov 2012
Posts:
12
#1
How to lock selected rows from reading in other session?
Nov 27 '12, 04:21 AM
How to block selected rows from reading in other session unless unlock it?
zmbd
Recognized Expert
Moderator
Expert
Join Date:
Mar 2012
Posts:
5501
#2
Nov 27 '12, 02:47 PM
Salsan,
You need to provide a little more detail as to how you are accessing the database.
Comment
Post
Cancel
salsan
New Member
Join Date:
Nov 2012
Posts:
12
#3
Nov 27 '12, 02:58 PM
Its for a multithreaded php application accessing mysql database from each instance. Whenever one instance is accessing the database the table must get locked from accessing other instances and other instances should wait till the lock release.
Comment
Post
Cancel
wholetthedogout
New Member
Join Date:
Nov 2012
Posts:
6
#4
Nov 27 '12, 06:23 PM
Can u please put in the code u tried so far.
Thank you.
Comment
Post
Cancel
zmbd
Recognized Expert
Moderator
Expert
Join Date:
Mar 2012
Posts:
5501
#5
Nov 27 '12, 07:25 PM
The code would be nice.
IMHO: this doesn't seem like a MySQL issue in as much as it is how PHP is opening the recordset and how the servers handle PHP actions.
I can move this thread to the PHP forum if you'd like.
Comment
Post
Cancel
salsan
New Member
Join Date:
Nov 2012
Posts:
12
#6
Nov 28 '12, 08:48 AM
Code:
LOCK TABLE email_list WRITE; SELECT * FROM email_list LIMIT 10; INSERT INTO ..... UNLOCK TABLES;
This is the query i have used in that.
Last edited by
zmbd
;
Nov 28 '12, 11:40 AM
.
Reason:
[Z{Please use the <CODE/> button in the toolbar to format posted code/SQL}]
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment