Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
PHP -> Parse error: syntax error, unexpected token ";" What is causing this???
Post Flair (click to view more posts with a particular flair)
Post Body

EDIT: View solution here:

​ ```<?php

// Defines database credentials $server = 'localhost'; $username = 'root'; $password = ''; $database = 'forum';

/* Attempt to connect to MySQL database */ $link = mysqli_connect($server, $username, $password, $database);

// Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } ?> ``` ​

Hey guys, so I have a file called "connect.php" that functions basically as my config file. I keep getting the error:

Parse error: syntax error, unexpected token ";"

Which I see an error in the syntax I believe, I think there should be another ")" after:

if(!mysql_select_db($database)

However that just throws a fatal error instead. I don't see any other syntax errors here, of what could be causing this. Any ideas?

//connect.php
$server = 'localhost';
$username   = 'root';
$password   = '';
$database   = 'verify-user';

if(!mysql_connect($server, $username,  $password))
{
    exit('Error: could not establish database connection');
}
if(!mysql_select_db($database)
{
    exit('Error: could not select the database');
}
?>

Author
Account Strength
90%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
906
Link Karma
192
Comment Karma
714
Profile updated: 4 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago