RE: [PHP] FW: parse error

From: Date: Thu, 13 Oct 2011 18:19:09 +0000
Subject: RE: [PHP] FW: parse error
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-315281@lists.php.net to get a copy of this message
At 02:06 PM 10/13/2011, Steve Staples wrote : [snip]
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
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...
That would only occur when the script is actually executed. It's not getting that far yet, since it's dying on a syntax error during the parse.
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
No, mysql_real_escape_string (http://php.net/mysql_real_escape_string) should be used, not addslashes, although there are some people who have suggested that even that function is not enough and that only using stored procedures is good enough. Ken

« previous php.general (#315281) next »