nightkarnation Posted April 13, 2011 Share Posted April 13, 2011 Hey Guys, I have the following problem. I have a lot of users sending querys to my DB at the same time, and for example each time a user sends the query, a field with a number increases. Sometimes that number increases like this: 10.11, 10.12, 10.13, 10.15, 10.14 When it obviously should be: 10.11, 10.12, 10.13, 10.14, 10.15 Maybe (in this example) the query from 10.15 finished first (got inserted on DB) than the query from 10.14. My question is if there is some kind of function or line of code to have some kind of queue between the Querys...so if a query that is received first must finish and the the next can go ahead and query. Hope I am making myself clear, Looking forward any kind of help and/or suggestions. Thanks a lot in advance! Link to comment https://forums.phpfreaks.com/topic/233560-php-mysql-query-queue/ Share on other sites More sharing options...
gizmola Posted April 13, 2011 Share Posted April 13, 2011 You can explicitly apply a write lock to the table. It will limit concurrency, but has the effect of serializing things in the way you desire. Link to comment https://forums.phpfreaks.com/topic/233560-php-mysql-query-queue/#findComment-1200983 Share on other sites More sharing options...
nightkarnation Posted April 14, 2011 Author Share Posted April 14, 2011 Thanks a lot for the kind help! LOCK TABLE helped a lot ! Link to comment https://forums.phpfreaks.com/topic/233560-php-mysql-query-queue/#findComment-1201373 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.