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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.