php连接MySQL数据库,怎么设置超时

WBOY
Release: 2016-06-13 13:46:48
Original
1282 people have browsed it

php连接MySQL数据库,如何设置超时
使用mysql_connect函数时,超过设置的时间连不上就返回失败。

请问这样需要如何设置?!

------解决方案--------------------
看看文档吧,话说如果php超时那服务器会有反应吧
------解决方案--------------------
set_time_limit(25);
加在你的mysql_connect函数里面 超时的话会报错 
可以用try catch包裹你的mysql_connect函数.
只给思路.祝好.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template