I am adding value that start with $ symbol in sql where clause. I execute the query in php.
worked - when wrap $n in double quote and whole query in single quote
$query= 'SELECT * FROM a
WHERE n="$n" '
not worked - wrap $n in single quote and whole query in double quote
$query= "SELECT * FROM a
WHERE n='$n' "
Why is it so? Thanks in advance.