I am creating a social networking site with php+mysql . currently i create a database connetion for my database in a function and i call it in the begining of every displayable page . I dont understand about how database connections works .
I read this link In PHP/MySQL should I open multiple database connections or share 1?. i get something from this but- how the database connection works when d开发者_C百科ifferent users login?
- Should i use different database connections for different purposes ?
For each run of PHP (each time someone requests a .php page), you generally need one connection. You only need different connections if you want to query different databases in the same script.
精彩评论