<?PHP
$link = mysqli_connect(‘localhost’, ‘root’, ‘Lmk01only’);
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 (!mysql_select_db($link, ‘ijdb’))
{
$output = ‘Unable to locate the joke database.’;
include ‘output.html.php’;
exit();
}
$output = ‘Database connection established.’;
include 'output.html.php;
?>
This line here you’re missing the ending quote and semicolon.
The error indicates line 9 because that’s where the PHP parser found the first single quote to match the one you omitted 3 lines earlier – it assumes this is the end of that string, but given that assumption the code following that is not valid PHP syntax, and it must give up and present an error.
Thankyou. After your first post I looked back and found I was missing the Endquote previously. This caused me to look through it all again and found a couple other errors I hadn’t noticed.
Try to use some text editor with code highlight feature.
It will show you where the problem is.
Even this forum can do it, with properly chosen language to highlight
Look, it highlights exit() as if it is string, but it is function:
<?PHP
$link = mysqli_connect('localhost', 'root', 'Lmk01only');
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.';
?>
it won’t help you with a semicolon though. But this kind of error will hint you to check semicolons above.