Parse error: syntax error, unexpected T_IF in 的问题 期望高手解决

kingsun6666712 2010-07-28 04:12:03
目前在testlink上做实验,在页面上出现了这样的报错:Parse error: syntax error, unexpected T_IF in D:\testlink\APMServ5.2.6\APMServ5.2.6\www\htdocs\testlink\lib\functions\database.class.php on line 46
下面是database.class.php 的源码:
<?php
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* @package TestLink
* @author Francisco Mancardi
* @author Mantis Team
* @copyright 2006 TestLink community
* @copyright 2002-2004 Mantis Team - mantisbt-dev@lists.sourceforge.net
* (Parts of code has been adapted from Mantis BT)
* @version "CVS: $Id: database.class.php,v 1.54 2010/04/28 06:29:05 franciscom Exp $"
* @link http://www.teamst.org/index.php
*
* @internal Revisions:
*
* 20100111 - franciscon - BUGID - display debug_print_backtrace() when query fails
* 20090720 - franciscom - fetchRowsIntoMap() - added some error management code
* 20090202 - franciscom - BUGID 1318 - fetchFirstRowSingleColumn() added new control
* 20081129 - franciscom - Added CUMULATIVE constant
* 20081116 - franciscom - fetchColumnsIntoMap() added cumulative argument
*
" * 20080722 - franciscom - trying to solve memory usage problems, have add option"
* to enable/disable query execution log.
* Setted to DISABLE by default.
*
* 20080722 - franciscom - problems with MSSQL and ADODB_FETCH_ASSOC
* 20080315 - franciscom - due to problems with PostGres with $ADODB_COUNTRECS=FALSE;
* return to default mode ($ADODB_COUNTRECS=TRUE;)
*
* 20080204 - franciscom - setting ADODB_FETCH_ASSOC as default fetch mode
" * 20060708 - franciscom - changed Connect() to NConnect(), to avoid"
" * problems due to connection reuse, when"
* you wanto to connect to more than one database at once
* See ADODB manuals
*/

/**
* As stated on ADODB documentation this set will improve performance but have a side
" * effect, for DBMS like POSTGRES method num_rows() will return ALWAYS -1, causing problems"
*/
$ADODB_COUNTRECS = TRUE;

"// To use a different version of ADODB that provided with TL, use a similar bunch of lines"
// on custom_config.inc.php
[size=18px]if( !defined('TL_ADODB_RELATIVE_PATH') )[/size]--->这是第46行
{
" define('TL_ADODB_RELATIVE_PATH','/../../third_party/adodb/adodb.inc.php' );"
}
require_once( dirname(__FILE__). TL_ADODB_RELATIVE_PATH );
require_once( dirname(__FILE__). '/logging.inc.php' );

/**
* TestLink wrapper for ADODB component
* @package TestLink
*/
class database
{
const CUMULATIVE=1;

var $db;
var $queries_array = array();
var $is_connected=false;
var $nQuery = 0;
var $overallDuration = 0;
private $logEnabled=0;
private $logQueries=0;

// timer analysis
function microtime_float() {
"list( $usec, $sec ) = explode( "" "", microtime() );"
return ( (float)$usec + (float)$sec );
}

function setLogEnabled($value)
{
$this->logEnabled=$value?1:0;
}

function getLogEnabled($value)
{
return $this->logEnabled;
}

function setLogQueries($value)
{
$this->logQueries=$value?1:0;
}

function getLogQueries($value)
{
return $this->logQueries;

........
........

不知道这行有什么错???期望高手能够解決。。期待。。
...全文
1597 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tangtxtx1 2011-07-04
  • 打赏
  • 举报
回复
少个分号";"结尾
仔细检查一下吧
美人心计1999 2010-07-29
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 dingsongtao 的回复:]
应该是你程序里的{}不配对,少了或多了。
仔细检查下
[/Quote]同意
Dleno 2010-07-28
  • 打赏
  • 举报
回复
应该是你程序里的{}不配对,少了或多了。
仔细检查下
amani11 2010-07-28
  • 打赏
  • 举报
回复
" define('TL_ADODB_RELATIVE_PATH','/../../third_party/adodb/adodb.inc.php' );"

前后的 ""什么意思呢,复制出错?


如果是,单单这个条件语句,没什么问题
CunningBoy 2010-07-28
  • 打赏
  • 举报
回复
没在你的代码中看见错误中说的T_IF,代码没贴全吧?
kingsun6666712 2010-07-28
  • 打赏
  • 举报
回复
剛才發的帖子第46行不清楚 重新發一下 第46行是這樣的:
if( !defined('TL_ADODB_RELATIVE_PATH') )

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧