Sorry for this stupid question.. but I have to know...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Sorry for this stupid question.. but I have to know...

Post by seodevhead »

Is it really imperative that I close the mysql connection on all my php files with mysql_close(); ??? I have been getting lazy and not closing the DB connection on a lot of files... is this bad? Thanks and sorry if this is a stupid question... you may delete if you don't want this in the forums. :(
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post by wtf »

no...

I've never used mysql_close()

From the manual

Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This is being discussed here --> viewtopic.php?p=326114#326114.
the PHP manual on [url=http://php.net/function.mysql_close]mysql_close()[/url] wrote:Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post by seodevhead »

Everah wrote:This is being discussed here --> viewtopic.php?p=326114#326114.
the PHP manual on [url=http://php.net/function.mysql_close]mysql_close()[/url] wrote:Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.
Thanks guys... I feel better.

P.S. You can delete this thread if you like... I know how some questions are too stupid for posting.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

It's not that some questions are too stupid... it's that some questions could be easily answered by searching the forums or google.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

seodevhead wrote:P.S. You can delete this thread if you like... I know how some questions are too stupid for posting.
Search first. Some questions are pretty stupid, others are very legitimate questions, often answered previously by someone helping someone else. Often times these answers can be found through our good friend Google, sometimes we can even find the answers here. But if it is at all possible, search for the answer before posting the question.

PS this thread does not need to be deleted.
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post by seodevhead »

Thanks guys.
Post Reply