1

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

5
  • What version of PHP are you using? The mysql API is gone as of PHP 7. Commented Mar 5, 2016 at 8:58
  • 7.0.3 What am I supposed to do now? Commented Mar 5, 2016 at 9:02
  • 1
    Use mysqli ("improved") or PHP Data Objects. Commented Mar 5, 2016 at 9:05
  • Thank you very very much :D Commented Mar 5, 2016 at 9:06
  • to elaborate a little: The extension providing the mysql_* functions has been removed from php7. see docs.php.net/mysqlinfo.api.choosing Commented Mar 5, 2016 at 9:21

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.