Php 错误消息:MySQL服务器已离开
我从上面的查询中得到了这个错误,我不知道如何解决它。下面是我的代码。新手可以接受任何帮助。。。谢谢Php 错误消息:MySQL服务器已离开,php,mysql,sql,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 readi
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
您的PHP脚本可能需要很长时间才能执行,因此您可能需要在PHP.ini中增加max_execution_time值
max\u execution\u time=600
这是10分钟参见此处:
MySQL服务器消失的最常见原因是错误
服务器超时并关闭了连接。在这种情况下,你
通常会得到以下错误代码之一(您得到的是哪一个
依赖于操作系统)
使用explain获得配置文件的查询结果。您可以跟踪查询所需的时间。
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