RE: FW: parse error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux