Can't connect to database

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can't connect to database

Postby gtsoukn » 16. March 2016 21:44

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.
Sorry for my bad English!!!
gtsoukn
 
Posts: 4
Joined: 16. March 2016 14:07
Operating System: Windows

Re: Can't connect to database

Postby Altrea » 16. March 2016 22:25

Hi,

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

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Can't connect to database

Postby gtsoukn » 16. March 2016 23:06

It was with two commas :shock:

Code: Select all
;;extension=php_mysql.dll


I removed the commas and now it's ok.

Thanks.
Sorry for my bad English!!!
gtsoukn
 
Posts: 4
Joined: 16. March 2016 14:07
Operating System: Windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 121 guests