0

我有一个共享主机帐户,我正在那里运行动态站点。我在数据库记录返回的某个时候面临以下问题。

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

我正在关闭执行查询的每个文件中的所有连接,例如 mysql_close($con);

仅仅是因为这个吗?还是可能有其他问题?我可以找出我缺少 mysql 关闭连接的问题吗?

有人可以帮我吗 ?谢谢

4

1 回答 1

1

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.

于 2013-10-03T13:18:58.723 回答