When is it the best time to close a database connect? Is it good to close it on every scripting page i do that uses it?
programmer12 0 Junior Poster in Training
Recommended Answers
Jump to PostError is based on coding and logic.
You have to increase your memory limit.
ini_set(’memory_limit’, '20M');But if your script is in end level recursion, above solution wont work.
Make sure your recursive function has one limit and break somewhere.
Jump to PostWhen is it the best time to close a database connect? Is it good to close it on every scripting page i do that uses it?
I use a database singleton design pattern. That makes easy with single close throughout the session!
All 7 Replies
Insensus 52 Junior Poster
programmer12 0 Junior Poster in Training
IIM 163 Master Poster
vibhaJ 126 Master Poster
programmer12 0 Junior Poster in Training
Stefano Mtangoo 455 Senior Poster
programmer12 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.