rajnikant
Feb 13th 2007, 4:39 am
In my application, I opened a non-persistent mysql db connection at the top of the php file and I have closed it at the end of php file. so all db query functions (for ex. query(), getall(), fetchonerow() etc..) will use the same resouce id and perform the tasks.
The other way I came to know is, establish a connection in all db functions first then perform the tasks and the close the opened connection at the end of all db functions.
Which one is more efficient and the best way ?
The other way I came to know is, establish a connection in all db functions first then perform the tasks and the close the opened connection at the end of all db functions.
Which one is more efficient and the best way ?