close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

log out user (too many connections mysql)

Thread began 9/06/2010 10:30 am by mr hankey | Last modified 9/07/2010 3:16 pm by Jason Byrnes | 622 views | 3 replies |

mr hankey

log out user (too many connections mysql)

hi,

i started to get "Too many connections" error from mysql database pointing to my connection file.

i checked in this and reading around it looks like the pconnect it has created needs to change to just connect.

has anyone had this before and is it ok to change it from pconnect without causing any problems with the rest of the site?

also i read that you should then close the connection properly with a command such as mysql_close()

where would this be added? would it be added in the user_logout page generated by security assist or does security assist already log out and close the connection properly?

many thanks

Sign in to reply to this post

Jason ByrnesWebAssist

you can change the connection file to use mysql connect instead of pconnect.

In the connection file, the last line establishes the connection:

For example the powerstore connection looks like:

php:
$PowerStoreConnection = mysql_pconnect($hostname_PowerStoreConnection, $username_PowerStoreConnection, $password_PowerStoreConnection) or trigger_error(mysql_error(),E_USER_ERROR);



you can chage this to:

php:
$PowerStoreConnection = mysql_connect($hostname_PowerStoreConnection, $username_PowerStoreConnection, $password_PowerStoreConnection) or trigger_error(mysql_error(),E_USER_ERROR);



to use the mysql connect method.


Closing the connection happens when you free the recordset results.

For each recordset you have on a page, you should have a mysql_free_result line at the end of the page:

php:
mysql_free_result($recordsetName);
Sign in to reply to this post

mr hankey

thanks jason dreamweaver automatically creates the mysql_free_result doesn't it?

is there any problem with me not using pconnect?

is this normal to have to change?

i have changed this and i am no longer getting the error so far. the hosting provider recommends not using pconnect.

will this affect any code generated by the extensions not using pconnect?

thanks again jason

Sign in to reply to this post

Jason ByrnesWebAssist

yes, Dreaweaver will add the free result code at the end of the page, double check that it is there though, there nothing stoping it from getting deleted on accident.

This is not a normal change to have to make, but if you host recommends not using the pconnect method, then you should make the change.


it will not have any effect on the scripts being generated.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...