Re: FW: parse error

From: Date: Thu, 13 Oct 2011 17:32:38 +0000
Subject: Re: FW: parse error
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-315277@lists.php.net to get a copy of this message
At 01:26 PM 10/13/2011, Robert Williams wrote:
On 10/13/11 10:06, "David Savage" <dsavage@cytelcom.com> wrote: php -l voip_cdrs.php PHP Parse error: parse error, unexpected T_STRING in /usr/local/cytrex/voip_cdrs.php on line 1050 Errors parsing voip_cdrs.php
                    $alias_sql_stmt="SELECT ani FROM ldrates WHERE
ani='$termnum10'";    // <-----this is line 1050
Could you please tell me what's wrong with the line 1050 ? I've been pulling my hair out (figuratively speaking) trying to understand why the compiler sees this line as a problem. Thanks for whatever help you can give. My suspicion is that there's is an unmatched curly brace earlier in the file. With this type of error, you'll generally get a report of a bad line further down the file--sometimes way down--because the parser can't recognize until it hits the later point that something is wrong. Try double-checking that the {Š} blocks prior to line 1050 properly balance, and you'll probably find there's an extra one, or that one is missing, etc.
It's more likely an unterminated quoted string. It looks like PHP is giving up after finding unrecognizable stuff after either the first double or single quote on that line. If you're using an editor that doesn't do syntax high lighting, get one. Ken

« previous php.general (#315277) next »