Can't connect to mysql database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
shanedara
Forum Newbie
Posts: 2
Joined: Thu Jun 26, 2008 8:20 am

Can't connect to mysql database

Post by shanedara »

Hi Im new to php/datase development and have gotten really stuck. Im trying to connect to a database I created in mysql but cant. Im not getting any errors that say it wont connect but I know that php is just ignoring all the mysql_connect and mysql_query functions. When I dont encase the $cxn variable in " " I get an error message saying

Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 13

can some one please help me with this.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Can't connect to mysql database

Post by Christopher »

You do not have the mysqli extension installed. Check your php.ini file or use phpinfo() to determine which MySQL extension you have installed (maybe mysql or PDO?)
(#10850)
shanedara
Forum Newbie
Posts: 2
Joined: Thu Jun 26, 2008 8:20 am

Re: Can't connect to mysql database

Post by shanedara »

Thanks for the reply. I looked into my php.ini file and found this line with no semi-colon infront

extension=php_mysqli.dll

is that what you mean? Is that what should be there? Sorry Im really new to this.
shrg18
Forum Newbie
Posts: 5
Joined: Wed Mar 12, 2008 8:21 pm

Re: Can't connect to mysql database

Post by shrg18 »

I have encountered the same error: Fatal error: Call to undefined function: mysqli_connect() in ...includes/mysql.inc.php on line 58

It occurs in the domain and all subdomains yesterday.

Before yesterday, it had never happened. All domains worked fine. I didn't upload new scripts.

Looked at each php.ini, mysqli extensions are commented out. Sent messages to the customer support, they didn't respond. Usually they respond quickly.

I use mysql i/o mysqli, the testing script works fine.

Can anyone give me a clue or guidance?
Post Reply