Jump to content

mysqli_connect error


futrose

Recommended Posts

Can anyone see what might be wrong with this?  I am getting this error.

Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\includes\db.inc.php on line 4

 

here is the file

<?php
//include $_SERVER['DOCUMENT_ROOT'] . '/dbinfo.inc.php';
//$link = mysqli_connect($host, $user, $password);
$link = mysqli_connect('ipaddress', 'root', '****');
if (!$link)
{
$error = 'Unable to connect to the database server.';
include 'includes/error.php';
exit();
}

if (!mysqli_set_charset($link, 'utf8'))
{
$error = 'Unable to set database connection encoding.';
include 'includes/error.php';
exit();
}

if (!mysqli_select_db($link, 'biblebaptist'))
{
$error = 'Unable to locate the database.';
include 'includes/error.php';
exit();
}
?>

 

it was working fine before, now it isn't.  I have the php.ini file set to mysqli by removing the ; from the line.  I'm not sure what else to check.  This is on my local machine (testing server) if that matters.

Link to comment
https://forums.phpfreaks.com/topic/229199-mysqli_connect-error/
Share on other sites

If your mysqli code previously worked, but does not now, it is likely that you accidentally typed a non-printing or a foreign language character as part of the function name.

 

I recommend completely retyping that line.

 

If your mysqli code never worked, then by turning on the error_reporting/display_errors settings, you have exposed an error that was always present.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.