简体   繁体   English

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

[英]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.

相关问题 解析错误:语法错误,意外\\'?> \\',期待函数(T_FUNCTION) - Parse error: syntax error, unexpected \'?>\', expecting function (T_FUNCTION) 解析错误:语法错误,意外的T_ELSE,在1834行的/home/filename.html.php中预期为T_FUNCTION - Parse error: syntax error, unexpected T_ELSE, expecting T_FUNCTION in /home/filename.html.php on line 1834 解析错误:语法错误,意外的“函数”(T_FUNCTION),预计在第319行 - Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting on line 319 ItemsController.php 第 97 行中的 FatalThrowableError:解析错误:语法错误,文件意外结束,需要函数 (T_FUNCTION) - FatalThrowableError in ItemsController.php line 97: Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) PHPUnit 3.6 PHP 5.2.7 PHP解析错误:语法错误,意外的T_FUNCTION,在/ usr / local / bin / phpunit的第16行中出现')' - PHPUnit 3.6 PHP 5.2.7 PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /usr/local/bin/phpunit on line 16 PHP,解析错误:语法错误,意外的T_IF,预期为T_FUNCTION - PHP, Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION PHP解析错误:语法错误,意外的T_STRING,预期的T_FUNCTION - PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION php解析错误:语法错误,意外的T_STRING,在构造上需要T_FUNCTION - php Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION on construct 语法错误,意外的T_FUNCTION,预期为')' - syntax error, unexpected T_FUNCTION, expecting ')' PHP版本5.2.14 /解析错误:语法错误,意外的T_FUNCTION,期望')' - PHP Version 5.2.14 / Parse error: syntax error, unexpected T_FUNCTION, expecting ')'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM