我有下面的代码,它运行时给我一个解析错误。我错过了明显的东西吗?
对不起 - 这里是完整的错误。它说,上线102,但最后标签之后是..
PHP Parse error: syntax error, unexpected $end in /var/www/cdr/outgoing_cdr.php on line 102
我看到未闭合支架,得到了固定变量的问题,现在它变得更远,但现在我看到这些错误:
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Notice: Array to string conversion in /var/www/cdr/outgoing_cdr.php on line 53
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Warning: mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: message: Could not find stored procedure 'Array'. (severity 16) in /var/www/cdr/outgoing_cdr.php on line 53
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Warning: mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: Query failed in /var/www/cdr/outgoing_cdr.php on line 53
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Warning: Invalid argument supplied for foreach() in /var/www/cdr/outgoing_cdr.php on line 53
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Notice: Use of undefined constant salesrep - assumed 'salesrep' in /var/www/cdr/outgoing_cdr.php on line 90
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Notice: Use of undefined constant repid - assumed 'repid' in /var/www/cdr/outgoing_cdr.php on line 91
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Warning: mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: message: Line 1: Incorrect syntax near ','. (severity 15) in /var/www/cdr/outgoing_cdr.php on line 97
[Wed May 25 10:14:34 2011] [error] [client 192.168.1.10] PHP Warning: mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: Query failed in /var/www/cdr/outgoing_cdr.php on line 97
53号线有foreach语句:
foreach (mssql_query($sqla) as $sqla_res) {
if (!$sqla_res)
{
die('Query (1) failed.');
} elseif (mssql_fetch_rows($sqla_res)==1)
{
$sqlares = $sqla_res;
$found = mssql_fetch_array($sqla,MSSQL_BOTH);
$clid = $found[clientid];
} elseif (mssql_fetch_rows($sqla_res)==0)
{
break;
}
}
97号线运行此查询:
INSERT INTO $table (extension, phonenumber, calldatetime, callID, name, repID, clientID, subscribed) VALUES ($extension, $phonenumber, CURRENT_TIMESTAMP, $callID, $name, $repid, $clid, $subs)
我想你忘了else状态的右括号在线77 – 2011-05-25 14:52:27
你在哪条线上得到它? – jimy 2011-05-25 14:53:07