what’s different between below two query’s on '".$string."' and '$string'
SELECT * FROM users WHERE UserName='".$USERNAME."' AND Pass='".$PASS."'
/* AND */
SELECT * FROM users WHERE UserName='$USERNAME' AND Pass='$PASS'
if different what’s better for security ? strings always secure on input but just for above differents
EDIT:
I use above querys on PHP JUST and need it on it
There is no difference between them in your case.
But you’ll see a difference if the string you’re concatenating does not contain special chars (such as
') :Is not equivalent to :
Because PHP will look for
$bcvariable. But this is equivalent to :As well as your example is equivalent to :
But take care, the single quotted string :
will be litteraly read as
a{$b}c.Finally, as @duskwuff warns, you should be aware of sql injections.