错误消息:MySQL服务器已经消失

时间:2014-01-01 13:24:24

标签: php mysql sql

Warning: mysql_query() [function.mysql-query]:
MySQL server has gone away in C:\wamp\www\amp10\hrd_consultant_ho_all_display.php on line 254

Warning: mysql_query() [function.mysql-query]: Error reading result set's header in C:\wamp\www\amp10\hrd_consultant_ho_all_display.php on line 254

Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\amp10\hrd_consultant_ho_all_display.php on line 254

我从查询中得到了上述错误,我不知道如何解决它。下面是我的代码。任何帮助被新手接受...谢谢

SELECT * , (SELECT CASE WHEN audited = 1 THEN 'YES' ELSE 'NO' END FROM activity_ref WHERE         
activity_ref.ref_no = activity_plan.ref_no ) AS test_audited
FROM 
activity_plan
inner join user on activity_plan.sales_officer=user.username
INNER JOIN activity_liquid ON activity_plan.aplan_no = activity_liquid.aplan_no
where activity_plan.date between '$date1' and '$date2' and user.branch='no' and     
user.position='Consultant' and activity_plan.validate_1st_status!='pending'  order by     
activity_plan.sales_officer asc,activity_plan.aplan_no asc  

2 个答案:

答案 0 :(得分:0)

您的PHP脚本可能需要很长时间才能执行,因此您可能需要在php.ini中增加max_execution_time值,

max_execution_time=600这是10分钟

答案 1 :(得分:0)

见这里:http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

  

MySQL服务器最常见的原因已经消失了   服务器超时并关闭连接。在这种情况下,你   通常会得到以下错误代码之一(你得到的是哪一个)   取决于操作系统。)