ajetrumpet Posted August 18, 2012 Share Posted August 18, 2012 Hi all, Yet another question for the experts here. As in the subject to this thread, I'm interested in finding out how PHP handles concurrent database connections when the script has a write operation in it. like for instance, this code: $sql = "UPDATE table1 field = 'new value' WHERE field = 'old value'"; mysql_query($sql) or die('Update Failed!'); if I have 10 people loading one of my pages at the same time and I'm updating the same database table (with different records for each user) with an update statement, am I risking errors or even corruption because of the write-conflict issue?? It seems to me that PHP would act somewhat like an operating system here and sequence the requests so that doesn't happen. True? thanks so much! Quote Link to comment Share on other sites More sharing options...
Christian F. Posted August 19, 2012 Share Posted August 19, 2012 This isn't handled by PHP, but the underlying database engine. For MySQL you can check out these links. http://stackoverflow.com/questions/2217106/concurrent-mysql-database-queries http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html I'm sure, when moved to the correct section, that the resident MySQL expert(s) can fill out on whatever info I'm missing. 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.