PHP MYSQL page requests
Posted 13 July 2006 - 04:30 PM
When a user calls a php page, and another user calls the same
can this result in database inconsistency?
which part of query's are executed atomically:
just 1 query?
1 php page?
please help me on this one?
Posted 13 July 2006 - 08:09 PM
Of course, I'm refering to SQL commands which change a table in some way (UPDATE, INSERT, or DELETE). SELECTs would be exempt.
MySQL (I'm assuming MySQL since you're posting in this forum, otherwise PostGRE, Oracle, whatever) handles the database functions. If a PHP with a table-altering SQL query is requested once, then immediately requested by another user, the inital SQL is carried out, then the second request "sees" the updated table.
Does that answer your question? There's plenty of information out there on database concurrency, atomicity, transactions, etc. Much of it is database developer theory and is not of the database user's concern.
Posted 13 July 2006 - 08:45 PM
and what about this:
//call query to add 1 to some field
//call query to substract 1 to same field
User 1 requests
User 2 requests
can this happen:
this can cause inconsistance if you are not using increment or decrement but getting values, changing them and then putting them
so are those queries in 1 php page 1 thing? cause i'm still not getting that part
Posted 13 July 2006 - 09:15 PM
Disclaimer: Free advice is usually worth what you paid for it. ( or at least when it's coming from me! )
Posted 13 July 2006 - 10:20 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users