Accessing the database concurrently in php
Posted: Wed Oct 26, 2011 4:52 pm
Hi,
I am new to php or server side processing. I have one question in php. When there are 100's of users accessing the same database for inserting a record, how should we maintain the connections with single user name?
From my understanding, we can do that in following ways
1) Use single user name to connect/disconnect/insert record into mysql database for all users. I understand it is not efficient way for doing all users.
2) use single user name and connect only at first time page loads and maintain the connection for certain time and disconnect the connection after certain period of idle time and then disconnect automatically if needed.
Which one of the approach is better? If the above two approaches are wrong, then what is the right method for accessing database concurrently without much resource overhead on the system.
Please help me.
I am new to php or server side processing. I have one question in php. When there are 100's of users accessing the same database for inserting a record, how should we maintain the connections with single user name?
From my understanding, we can do that in following ways
1) Use single user name to connect/disconnect/insert record into mysql database for all users. I understand it is not efficient way for doing all users.
2) use single user name and connect only at first time page loads and maintain the connection for certain time and disconnect the connection after certain period of idle time and then disconnect automatically if needed.
Which one of the approach is better? If the above two approaches are wrong, then what is the right method for accessing database concurrently without much resource overhead on the system.
Please help me.