PHP分析错误-意外的$end
我有下面的代码,它在运行时给了我一个解析错误。我错过了什么明显的东西吗 抱歉-这是全部错误。第102行写着,但在最后一个标签后面PHP分析错误-意外的$end,php,sql,sql-server,parsing,Php,Sql,Sql Server,Parsing,我有下面的代码,它在运行时给了我一个解析错误。我错过了什么明显的东西吗 抱歉-这是全部错误。第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] [clien
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
第97行正在运行此查询:
INSERT INTO $table (extension, phonenumber, calldatetime, callID, name, repID, clientID, subscribed ) VALUES ($extension, $phonenumber, CURRENT_TIMESTAMP, $callID, $name, $repid, $clid, $subs)
查找
$subs=$subs_f[subscribed]
并在后面添加一个}
一个小提示,将您的错误报告更改为E\u ALL
,看看您实际遇到了多少问题
Foreach Fix:
$resource = mssql_query($sqla);
while($row = mssql_fetch_assoc($resource))
{
echo $row['column']; //This is an example
}
第二个else块没有闭合曲括号。在第79行之后闭合打开的括号。我注意到两个问题:
从第77行开始没有右括号else
(错误原因)}
- 在线#99而不是
您可能想要if(!$sql)
if(!$result)
$array['index']
告诉php你用字符串搜索!谢谢,这很有道理。不过,我把foreach()怎么了?谢谢,这两个都有。也称为$cidname;应该是$phonenumber.Closed,现在看到新的、不相关的错误。有什么想法吗?
$resource = mssql_query($sqla);
while($row = mssql_fetch_assoc($resource))
{
echo $row['column']; //This is an example
}
} else {
$sql_subs = "SELECT subscribed FROM $tbl_mkt WHERE clientid = $clid";
$subs_res = mssql_query($sql_subs);
if (!$subs_res) {
die('Query (2) failed.');
} else {
$subs_f = mssql_fetch_array($sqla,MSSQL_BOTH);
$subs = $subs_f[subscribed];
}