-----Original Message-----
From: Ken Robinson [mailto:kenrb...@rbnsn.com] 
Sent: Thursday, October 13, 2011 1:33 PM
To: php-general@lists.php.net
Subject: Re: [PHP] FW: parse error

At 01:26 PM 10/13/2011, Robert Williams wrote:
>On 10/13/11 10:06, "David Savage" <dsav...@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.


I would suggest that you figure out what is the value of the variable your 
passing into your query....  is it possible that the value is getting a ' 
character, in which case it would be crapping out the line...

For now, try adding [addslashes]:
 $termnum10=addslashes(substr($dest, $start_from_which_offset,10));
 $alias_sql_stmt="SELECT ani FROM ldrates WHERE ani='$termnum10'";    // 
<-----this is line 1050


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to