28, May 2012

is mysql_close not needed in access_user_class? - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: is mysql_close not needed in access_user_class?
« previous next »
Pages: [1] Print

Author Topic: is mysql_close not needed in access_user_class?  (Read 2306 times)
I crack Photoshop!
*
Posts: 3
22 credits
Members referred : 0


« on: Aug 08, 2006, 08:46:00 am »

Hi - I am using your user class which I have found very useful.

However I was just wondering if mysql results connections need to be closed with:

mysql_free_result();
mysql_close();

Is a new connection made each time - just wondering if this is extra unnecessary overhead?

Thanks,
fergal
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Aug 08, 2006, 08:47:55 am »

php automatically closes the connections when a script ends execution.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
I crack Photoshop!
*
Posts: 3
22 credits
Members referred : 0


« Reply #2 on: Aug 08, 2006, 09:00:32 am »

thanks for the speedy response. So what are mysql_free_result and mysql_close used for then? and why have I been using them in my code up to this.

Thanks again,
Fergal
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #3 on: Aug 08, 2006, 09:03:43 am »

Well they just decrease the overhead by a bit, because if for example you do some queries and then do some other stuff that don't need the database connection, then you can close it so the server will have more resources available.

BTW welcome to webdigity fergalfrog Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Aug 08, 2006, 09:06:33 am »

... if you use the php function mysql_pconnect you need to close the connection.

use mysql_free_result if you have big result sets

I crack Photoshop!
*
Posts: 3
22 credits
Members referred : 0


« Reply #5 on: Aug 10, 2006, 12:36:44 pm »

Cool thanks for the answers guys....
I love Pokemon
*
Posts: 14
92 credits
Members referred : 0


« Reply #6 on: Sep 24, 2007, 07:02:29 pm »

I get this error:

Warning: mysql_connect() [function.mysql-connect]: User **** has already more than 'max_user_connections' active connections in /****/****/****/httpd.www/classes/access_user/access_user_class.php on line 135

I'm not opening more connections myself somewhere. The startpage displays no errors. after browsing a couple of links at my site the error appears (at the startpage aswell if you go to 'hom').
Can i close the connection somewhere ?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Sep 24, 2007, 07:46:49 pm »

I get this error:

Warning: mysql_connect() [function.mysql-connect]: User **** has already more than 'max_user_connections' active connections in /****/****/****/httpd.www/classes/access_user/access_user_class.php on line 135

I'm not opening more connections myself somewhere. The startpage displays no errors. after browsing a couple of links at my site the error appears (at the startpage aswell if you go to 'hom').
Can i close the connection somewhere ?

ask your provider to fix this problem

I love Pokemon
*
Posts: 14
92 credits
Members referred : 0


« Reply #8 on: Sep 24, 2007, 09:57:38 pm »

Ok, if the problem keeps occuring again i ask them to look into it. Thanks for your reply olaf.

By the way, I got my website up and running pretty nicely now. If anyone wants to know how to use access_user class with 1 file (index.php) where different sections get included instead of static pages give me a shout Wink
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3572
Tags : php mysql webdigity databases Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: is mysql_close not needed in access_user_class?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:53:01 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.