不建议使用:mysql

编程入门 行业动态 更新时间:2024-10-10 10:28:23
本文介绍了不建议使用: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/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/connx.php on line 7 Apr 3, 2014 checking

内部代码看起来是这样的

The inner code looks this way

justpaste.it/eyk2

所以我认为将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

本文发布于:2023-11-24 23:10:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627272.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:建议   mysql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!