PHP:未定义函数mysql_connect() [英] PHP : Undefined function mysql_connect()
本文介绍了PHP:未定义函数mysql_connect()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚下载了新的xampp
并尝试运行旧项目,但出现此错误
I just downloaded the new xampp
and try to run my old projects and I got this error
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in F:\xampp\htdocs\try\index.php:17 Stack trace: #0 {main} thrown in F:\xampp\htdocs\try\index.php on line 17
这是否意味着新的xampp不支持我使用的mysql_connect
?
Does it mean that the mysql_connect
that I used is not already supported in new xampp ?
推荐答案
mysql_connect()
已从最新的xampp版本所使用的PHP7中删除.
has been removed from PHP7, which is used by the newest xampp version.
请改为使用 mysqli_connect(),如本例所示.
Instead, use mysqli_connect() like in this example.
另一种方法 PDO 也可以(但编码方式与mysql_connect完全不同). )
Another method, PDO is also possible (but is coded in a very different way as mysql_connect.)
这篇关于PHP:未定义函数mysql_connect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文