Yong Scott
asked on
PHP FILE
<?php
$conn=mysql_connect(`localhost'," root","") or die("Could not connect");
mysql_select_db("bng_nov",$conn) or die("could not connect database");
?>
Parse error: syntax error, unexpected end of file, expecting '`' in C:\xampp\htdocs\display\db
I got the error
Perhaps ` should be '
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well, you changed the first \` to a \" which will generate the same error.
You must balance your quotes around localhost, so try "localhost" or 'localhost'. Whatever quote you use must be the same to start + end localhost.
Reread Shaun's comment carefully again. He suggested you change the leading \` to match the trailing \' around localhost.
You must balance your quotes around localhost, so try "localhost" or 'localhost'. Whatever quote you use must be the same to start + end localhost.
Reread Shaun's comment carefully again. He suggested you change the leading \` to match the trailing \' around localhost.
Hey David.
Oops - that was a typo in my code, not the Authors ;)
Oops - that was a typo in my code, not the Authors ;)
ASKER
guys i settle it already i use
<?php
$servername = "localhost";
$username = "root";
$password = "";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>