![]() |
sponsored links |
|
|
sponsored links
|
|
|
5
21st April 20:37
External User
Posts: 1
|
1) PHP applications are built on the concept of shared-nothing. Every page
request is, and should be, entirely independent of another. That is by design. It's weird if you're used to stateful programming (desktop, JSP, etc.), but it is actually very powerful. 2) If you really need to persist something, keep it small and use sessions[1]. They exist for that purpose. 3) 95% of the time, persistent connections to SQL servers are more trouble than they're worth. If you're using MySQL or SQLite in particular, the connection cost is tiny. In practice it's better to just let the connection die at the end of the request and re-open it at the start of the next request. The web has been optimized over the past decade for that usage pattern. [1] http://www.php.net/sessions -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson |
|