<?php
$link = mysqli_connect ('localhost', 'root', 'nestle324');
if (!$link)
{
$output = 'Unable to connect to the database server.';
include 'output.html.php';
exit();
}
if (!mysqli_set_charset($link, 'utf8'))
{
$output = 'Unable to set database connection encoding.';
include 'output.html.php';
exit();
}
if (!mysqli_select_db($link, 'ijdb'))
{
$output= 'Unable to locate the joke database.';
include 'output.html.php';
exit();
}
$output = 'Database connection established.';
include 'output.html.php';
?>
I keep getting this error:
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2
There’s no error coming up. What version of PHP are you running? The only thing I changed was the database login details.
Edit-I moved the file from the base, into the root. So you can’t get to it. But it basically only says the error about the joke database not being able to be selected. Which, if I gave it my database name, it wouldn’t have that issue.