I have the following code, and it's giving me a parse error when run. Am I missing something obvious?
Sorry - here's the full error. It says on line 102, but that's after the last tag..
PHP Parse error: syntax error, unexpected $end in /var/www/cdr/outgoing_cdr.php on line 102
I see the unclosed bracket, got that, fixed the variable issues, now it's getting much further, but am seeing these errors now:
[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
Line 53 has the foreach statement:
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;
}
}
Line 97 is running this query:
INSERT INTO $table (extension, phonenumber, calldatetime, callID, name, repID, clientID, subscribed ) VALUES ($extension, $phonenumber, CURRENT_TIMESTAMP, $callID, $name, $repid, $clid, $subs)