futrose Posted March 1, 2011 Share Posted March 1, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/229199-mysqli_connect-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 1, 2011 Share Posted March 1, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/229199-mysqli_connect-error/#findComment-1181040 Share on other sites More sharing options...
randmary29 Posted March 1, 2011 Share Posted March 1, 2011 check the folder of it Quote Link to comment https://forums.phpfreaks.com/topic/229199-mysqli_connect-error/#findComment-1181043 Share on other sites More sharing options...
futrose Posted March 1, 2011 Author Share Posted March 1, 2011 I tried retyping the line... no luck. For some reason I decided to try restarting apache which solved the problem. Thanks for trying to help out. Quote Link to comment https://forums.phpfreaks.com/topic/229199-mysqli_connect-error/#findComment-1181225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.