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.
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');
}
?>
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/CodingHelp/...