Can anyone suggest how to solve this error in php "Fatal error: Uncaught Error: Call to undefined function mysql_connect()" ? I am using php 7.0.4 and php extension is mysqli.
Asked
Active
Viewed 1,101 times
-1
-
you are trying to connect by using mysql_connect() instade of mysqli_connect(). you are saying you had extension for mysqli then you should go for mysqli_connect(). – Hirendrasinh S. Rathod Apr 08 '16 at 04:22
-
[Searched the website yet](http://stackoverflow.com/a/35025964/4982088)? Has been answered dozens of times. I only raise my eyebrow that you think that mysql**i** refers to this error. – Xorifelse Apr 08 '16 at 04:33
-
I have changed the mysql_connect() function to mysqli_connect() but it is showing the same error. – nnnnnn Apr 08 '16 at 04:40
-
That means you need to enable the extensions in your php.ini – Xorifelse Apr 08 '16 at 18:03
2 Answers
0
you are trying to connect by using mysql_connect() instade of mysqli_connect().
you are saying you had extension for mysqli then you should go for mysqli_connect().

Hirendrasinh S. Rathod
- 824
- 6
- 11
0
You are using a PHP function that was removed on PHP 7
http://php.net/manual/en/function.mysql-connect.php
use mysqli_connect() instead.

Aljay
- 456
- 7
- 21