解析错误:语法错误,第6行/home/a3206525/public_html/easymailer/inc/db_wrapper.php中的意外T_DNUMBER

时间:2015-01-05 16:21:42

标签: php

我对PHP编码很新,并希望看到它可以获得以下代码的帮助。显然,错误仅在第6行。

<?php
class DBWrapper
{   
    function DBWrapper($server,$db,$user,$pass)
    {        
        $this->Server = $server;
        $this->DB = $db;
        $this->User = $user;
        $this->Password = $pass;

        mysql_connect($this->Server, $this->User, $this->password) or
                    die("Can't connect, please check your settings. Here is the MySQL error: ".mysql_error());

        mysql_select_db($this->DB) or
                    die("Can't select DB, please check your settings. Here is the MySQL error: ".mysql_error());       
    }

我真的希望得到一些帮助。

2 个答案:

答案 0 :(得分:3)

此:

    $this->Server = $mysql3.000webhost.com;

你对此字符串没有引号&#34;所以它被解析为:

$this->Sever = somevariable concatenate with undefined/illegal constant concatenate with undefined constant

也许

    $this->Server = '$mysql3.000webhost.com';

还是什么?

答案 1 :(得分:1)

    $this->Server = $#####;
    $this->DB = $#####;
    $this->User = $######;
    $this->Password = $#######;
嗯,不是那些字符串吗?如果是,请跳过$并将其放入'

    $this->Server = 'mysql3.000webhost.com';
    $this->DB = 'a3206525_ezmail';
    $this->User = 'a3206525_ezmail';
    $this->Password = 'belfegor666';

此外,发布您的凭据并不明智;)

最重要的建议,请阅读更多关于PHP的内容。它真的会帮助你。