解析错误:语法错误,意外'=',在第33行的DB_driver.php中期待T_FUNCTION

时间:2013-10-09 04:00:56

标签: php mysql

有一个程序,编码器设计但不会帮助设置它。我在尝试将代码连接到数据库时遇到此错误

解析错误:语法错误,意外'=',期待第33行\ system \ database \ DB_driver.php中的T_FUNCTION

我已经仔细检查了主机名,用户名,密码和数据库名称但没有获胜。

var $hostname;      = 'localhost';
var $username;      = 'pepadmin';
var $password;      = '******';
var $database;      = 'databasetest';
var $dbdriver       = 'mysql';
var $dbprefix       = '';
var $char_set       = 'utf8';
var $dbcollat       = 'utf8_general_ci';
var $autoinit       = TRUE; // Whether to automatically initialize the DB
var $swap_pre       = '';
var $port           = '';
var $pconnect       = FALSE;
var $conn_id        = FALSE;
var $result_id      = FALSE;
var $db_debug       = FALSE;
var $benchmark      = 0;
var $query_count    = 0;
var $bind_marker    = '?';
var $save_queries   = TRUE;
var $queries        = array();
var $query_times    = array();
var $data_cache     = array();
var $trans_enabled  = TRUE;
var $trans_strict   = TRUE;
var $_trans_depth   = 0;
var $_trans_status  = TRUE; // Used with transactions to determine if a rollback should occur
var $cache_on       = FALSE;
var $cachedir       = '';
var $cache_autodel  = FALSE;
var $CACHE; // The cache class object

// Private variables
var $_protect_identifiers   = TRUE;
var $_reserved_identifiers  = array('*'); // Identifiers that should NOT be escaped

// These are use with Oracle
var $stmt_id;
var $curs_id;
var $limit_used;

3 个答案:

答案 0 :(得分:3)

首先,您可能不需要所有var声明。另外,在定义它们之前,用分号终止这些行。

var $hostname;      = 'localhost';
var $username;      = 'pepadmin';
var $password;      = '******';
var $database;      = 'databasetest';

vs你的意图

$hostname      = 'localhost';
$username      = 'pepadmin';
$password      = '******';
$database      = 'databasetest';

答案 1 :(得分:0)

在变量尝试此

后删除分号
    var $hostname      = 'localhost';
    var $username     = 'pepadmin';
    var $password     = '******';
    var $database      = 'databasetest';

答案 2 :(得分:0)

不需要var,在初始化变量之前不应使用分号。删除标记的字符。

var $ hostname ; ='localhost';

var $ username ; ='pepadmin';

var $ password ; =' ** ';

var $ database ; ='databasetest';