问题:
学习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' );