Fatal error: Uncaught Error: Call to undefined function mysql_connect() in F:\wamp\apache\htdocs\ind

问题:

学习PHP时候,测试apache是否加载PHP中的拓展,再index.php输入如下代码:

<?php
//phpinfo();
mysql_connect('localhost:3306','root','123456' );

结果打开页面出现错误,;如下:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in F:\wamp\apache\htdocs\index.php:3 Stack trace: #0 {main} thrown in F:\wamp\apache\htdocs\index.php on line 3

解决办法:将mysql_connect()改写为mysqli_connect()

<?php
//phpinfo();
mysqli_connect('localhost:3306','root','123456' );
发布了102 篇原创文章 · 获赞 49 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/SoWhatWorld/article/details/104374272