Domanda

I have one shared hosting account and i am running dynamic site there. i am facing below problem sometime where database record returns.

Warning: mysql_connect() [function.mysql-connect]: User myuser already has more than 'max_user_connections' active connections in path/db.php on line 4
Could not connect: User myuser already has more than 'max_user_connections' active connections

I am closing all connections like mysql_close($con) in each file where i execute the query;

is it just because of this ? or there could be some other issue? can i trace out the problem where i am missing the mysql closing connection ?

can someone help me out ? Thanks

È stato utile?

Soluzione

Do not open and close connection on each file or worse on each query. Make a file similar to connection.php where you put the mysql_connect statement and use require_once where you want to use it. do not use mysql_close since the connection gets closed automatically each time the script finishes.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top