jhale1966 Posted June 9, 2003 Share Posted June 9, 2003 Greetings! I am Soooooo glad I found this site. It actually helped me finish my Game Project (http://www.dk-tower.com) but while working on it, I ran into some issues. While looking at the code (which I based on the Membership System Tutorial v1) , there seem to be an awful lot of hits to the database and at times, the website (game & support site itself) show MySQL errors (Too Many Connections). Is there something I can do to optimize the code so that it doesn\'t do this? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/563-too-many-connections-accessing-mysql-from-php/ Share on other sites More sharing options...
barbatruc Posted June 9, 2003 Share Posted June 9, 2003 Use persistent connections. If you use MySQL, instead of connecting to the MySQL server with mysql_connect(), use mysql_pconnect(). This might help. JP. Quote Link to comment https://forums.phpfreaks.com/topic/563-too-many-connections-accessing-mysql-from-php/#findComment-1892 Share on other sites More sharing options...
jhale1966 Posted June 10, 2003 Author Share Posted June 10, 2003 I was wondering about that. What happens if a person gets into the game, opens the connection and then leaves? Does the next person open a new connection or do they just \'piggyback\' onto the existing one? Quote Link to comment https://forums.phpfreaks.com/topic/563-too-many-connections-accessing-mysql-from-php/#findComment-1909 Share on other sites More sharing options...
shivabharat Posted June 10, 2003 Share Posted June 10, 2003 I am not sure whether a pconnect would help but for sure u have to increase the mysql connection which can be done by changing the config file. Quote Link to comment https://forums.phpfreaks.com/topic/563-too-many-connections-accessing-mysql-from-php/#findComment-1910 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.