开发者

database connections for social networking site

开发者 https://www.devze.com 2023-04-01 17:53 出处:网络
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 understan

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

  1. how the database connection works when d开发者_C百科ifferent users login?

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消