Warning: mysql_pconnect(): MySQL server has gone away with using cloud database

╄→гoц情女王★ 提交于 2019-12-22 11:28:30

问题


Warning: mysql_pconnect(): MySQL server has gone away in D:\xampp-portable\htdocs\project\database\dbconn.php on line 16

I got this error on the top of the page, but the page shows correctly. How can i solve this problem or just avoid showing the warning on the page? I am using Cleardb created from Windows Azure trial.

line 16: $conn = mysql_pconnect($hostname_conn, $username_conn, $password_conn,TRUE) or trigger_error(mysql_error(),E_USER_ERROR);


回答1:


You'll get this error any time you get back a persistent connection that has since timed out.

Is there a specific reason why you are using mysql_pconnect instead of mysql_connect? If not, try using mysql_connect instead.

If this is new code, you shouldn't be using the mysql_* functions at all as they are inherently unsafe and will soon be deprecated. Use PDO instead if possible.



来源:https://stackoverflow.com/questions/14060235/warning-mysql-pconnect-mysql-server-has-gone-away-with-using-cloud-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!