php的新手,尝试使用此连接到mysql数据库:
<?php
//connect.php
$server = 'localhost';
$username = 'usernamehere';
$password = 'passwordhere';
$database = 'databasenamehere';
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'); // This is line 14
}
?>
我明白了
Parse error: syntax error, unexpected ';' in D:\xampp\htdocs\connect.php on line 14
有人知道为什么吗?是的,我尝试删除了“;”在第14行上。