[英]Parse error: syntax error, unexpected '=', expecting T_FUNCTION in DB_driver.php on line 33
Got a program that a coder designed but wasn't will to help setup it up. 得到了一个编码员设计的程序,但没有帮助安装它。 I am getting this error when trying to connect the code to the database
尝试将代码连接到数据库时出现此错误
Parse error: syntax error, unexpected '=', expecting T_FUNCTION in \\system\\database\\DB_driver.php on line 33 解析错误:语法错误,意外的'=',在第33行的\\ system \\ database \\ DB_driver.php中预期为T_FUNCTION
I have double checked the hostname,username,password, and database name but with no victory. 我仔细检查了主机名,用户名,密码和数据库名,但没有获胜。
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;
first off, you probably don't need all those var
declarations. 首先,您可能不需要所有这些
var
声明。 also, you are terminating these lines with the semicolon before you even define them. 同样,您甚至在定义它们之前就用分号终止这些行。
var $hostname; = 'localhost';
var $username; = 'pepadmin';
var $password; = '******';
var $database; = 'databasetest';
vs what you intended 与您的意图
$hostname = 'localhost';
$username = 'pepadmin';
$password = '******';
$database = 'databasetest';
remove semicolen after the variables try this 尝试变量后删除分号
var $hostname = 'localhost';
var $username = 'pepadmin';
var $password = '******';
var $database = 'databasetest';
No need var and should not use semicolon before initializing variable. 不需要var,并且在初始化变量之前不应使用分号。 Remove the marked chars.
删除标记的字符。
var
$hostname ;
var
$ hostname ;
= 'localhost'; ='本地主机';
var
$username ;
var
$ username ;
= 'pepadmin'; ='pepadmin';
var
$password ;
var
$ password ;
= ' ** '; =' ** ';
var
$database ;
var
$ database ;
= 'databasetest'; ='数据库测试';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.