不建议使用:mysql_pconnect(): [英] Deprecated: mysql_pconnect():
问题描述
我在执行php时遇到错误,我认为这是由于更新了php 5.5引起的.
i am getting an error during a php execution which i think it was due to a newer php 5.5 thing.
不建议使用:
mysql_pconnect()
:不建议使用mysql扩展,以后将删除:在第7行的/public_html/mydomain.com/connx.php中使用mysqli或PDO代替. 2014年4月3日
检查
Deprecated:
mysql_pconnect()
: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /public_html/mydomain.com/connx.php on line 7
Apr 3, 2014
checking
内部代码看起来是这样的
The inner code looks this way
所以我认为将mysql
更改为mysqli
可以解决问题:
So i thought changing the mysql
to mysqli
could solve the issue :
$conn = mysqli_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error("Server Down");
相反,我收到此错误...所以我想这不是正确的方法:)
And instead, I'm getting this error... so i guess it was not the correct way of doing so :)
致命错误:调用未定义的函数
mysqli_pconnect()
无论如何我都可以解决此问题?该代码是很久以前构建的,现在我无法与他取得联系:x
anyhow i can fix this issue ? The code was built long time ago and now i cant really get in touch with him :x
谢谢 ** 更新 ** 我更改了mysqli_connect,并在加载php脚本时...现在显示了几个错误...只是想知道我是否也必须更改这些语法吗?
thanks ** UPDATED ** I changed the mysqli_connect and when i load the php script... it shows few errors now... just wondering do i have to change these syntax too ?
mysql_select_db($database_conn);
mysql_query("SET NAMES UTF8");
推荐答案
请参见 mysql_pconnect
:
此功能的替代方法包括:
Alternatives to this function include:
mysqli_connect()
,带有p:主机前缀
因此,请使用mysqli_connect
而不是mysqli_pconnect
并按照说明修改主机参数
So use mysqli_connect
, not mysqli_pconnect
and modify the host argument as described
这篇关于不建议使用:mysql_pconnect():的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!