解析错误:语法错误,意外的';'在第14行

时间:2019-05-20 21:53:14

标签: php

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行上。

0 个答案:

没有答案