why do you use {} around variables in following sql statement?
SELECT
FROM users
WHERE username = '{$_POST['user']}'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I presume you are using SQL from within PHP language.
This syntax with
{}is used to interpolate array elements embedded in quoted string.For example, composing the following string:
will compile output with the value of variable (array element) dereferenced, for instance:
SQL queries in PHP are composed from strings, so this
{}syntax is used fairly often.Reference: Variable parsing – complex syntax PHP4+
p.s. It’s always a good idea to provide as many details as possible in your question.