简体   繁体   中英

php error:Call to undefined function mysql_connect()

Okay I know this question has been asked multiple times but sadly, I was still unable to fix the problem.

When trying to run this simple script:

<?php

   mysql_connect('localhost','root','');

?>

I get the error mentioned in the title.
Info:
-I am using XAMPP
-There is a folder named mysql in my XAMPP folder
-I put this line on my php.ini: extension=php_mysql.dll and there already was: extension=php_pdo_mysql.dll
-I am using Widnows.
Any help would be greatly appreciated

If you are using php7, mysql_* functions are removed as they are deprecated use mysqli_* instead.

Here is a link you can use http://php.net/manual/en/function.mysqli-connect.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM