Page 1 of 1

Can't connect to database

PostPosted: 16. March 2016 21:44
by gtsoukn
Hi.

I have problem to connect to database with new version.
Running the site I have the message:
Fatal error: Call to undefined function mysql_connect() in E:\xampp\htdocs\pois\connectdb.php on line 3

The connectdb.php is
Code: Select all
<?php
//Create a connection to MySQL
$con = mysql_connect("localhost","root","")
             or die( 'Connection failed: ' . mysql_error() );
mysql_select_db("pois", $con) or die( mysql_error() );
mysql_query("SET NAMES 'utf8'", $con);
?>

I use the XAMPP without setting changes.

OS: Windows 10
XAMPP Ver.: xampp-win32-5.6.19-0-VC11


P.S. I used xampp-win32-5.6.3-0-VC11 version until now without problems.

Re: Can't connect to database

PostPosted: 16. March 2016 22:25
by Altrea
Hi,

Please check if extension=php_mysql.dll is uncommented in your php.ini!?

best wishes,
Altrea

Re: Can't connect to database

PostPosted: 16. March 2016 23:06
by gtsoukn
It was with two commas :shock:

Code: Select all
;;extension=php_mysql.dll


I removed the commas and now it's ok.

Thanks.