This question already has answers here:
Undefined function mysql_connect() [duplicate]
(14 answers)
Closed 6 years ago.
I hit this error when running a PHP script on XAMPP, in Windows. Does anyone know how solved it?
Fatal error: Call to undefined function mysql_connect() in
C:\xampp\htdocs\netbanking\dbconnection.php on line 2.
Try:
<?php
phpinfo();
?>
Create and call the page with above code and search for mysql. If not found, Do the following things.
Open your php.ini and
Changed from
;extension=php_mysql.so
into
extension=php_mysql.so
NOTE: mysql extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.
Related
This question already has answers here:
Error : Your PHP installation appears to be missing the MySQL extension which is required by WordPress
(7 answers)
Why shouldn't I use mysql_* functions in PHP?
(14 answers)
Closed 2 years ago.
I recently updated my site hosted on HostGator from PHP 5.4 to 7.4. I got this error:
Warning: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in /home1/keziavida/public_html/wp-includes/load.php on line 115
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
Does anyone know how to fix this?
This question already has answers here:
Why shouldn't I use mysql_* functions in PHP?
(14 answers)
Closed 6 years ago.
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.
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().
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.
http://php.net/manual/en/function.mysqli-connect.php
This question already has answers here:
"Call to undefined function mysql_connect()" after upgrade to php-7 [duplicate]
(1 answer)
Undefined function mysql_connect() [duplicate]
(14 answers)
Closed 7 years ago.
I just downloaded the new xampp and try to run my old projects and I got this error
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in F:\xampp\htdocs\try\index.php:17 Stack trace: #0 {main} thrown in F:\xampp\htdocs\try\index.php on line 17
Does it mean that the mysql_connect that I used is not already supported in new xampp ?
mysql_connect()
has been removed from PHP7, which is used by the newest xampp version.
Instead, use mysqli_connect() like in this example.
Another method, PDO is also possible (but is coded in a very different way as mysql_connect.)
The MySQL module is depreciated in PHP5 and removed in PHP7, you can use these:
MySQLi http://php.net/manual/en/book.mysqli.php
PHP::PDO http://php.net/manual/en/book.pdo.php
Check your version by using phpinfo().
Not particularly by xamppp but php itself deprecated mysql Here a quote from them:
The original MySQL extension is now deprecated, and will generate E_DEPRECATED errors when connecting to a database. Instead, use the MySQLi or PDO_MySQL extensions
if you can provide us php version i can help more
This question already has answers here:
"Call to undefined function sqlsrv_connect()" when trying to connect to Azure DB from PHP
(2 answers)
Closed 6 years ago.
How can I get sqlsrv in Registered PHP Streams of my php installation?
I am getting the following error:
Fatal error: Call to undefined function sqlsrv_error() in C:\inetpub\wwwroot\twickenham2013\class\sqlsrv.class.php on line 14
How can I fix this?
Im facing the same issue.
Thats because the Registered PHP streams(phpinfo()) does not contain sqlsrv field.
this can be checked using the code
<?php
phpinfo();
?>
add the necessary .dll files in you xampp/php/ext. and edit the php.ini document.
To download the necessary .dll files and for more detailed installation instructions, see the PHP docs: http://php.net/manual/en/sqlsrv.installation.php
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
mssql_connect in php does not exist
How to solve the following error
Fatal error: Call to undefined function mssql_connect() in /var/www/delhunt/MSSQLTest.php on line 8
You have to enable msssql functions from the php.ini file and check for php_mssql.dll in the php extensions folder