What is {} in a SQL query?
$SQLSTR = "SELECT name from user where id= ' {$row [0]} '";
My classmate write code, ask inside of {} Play what function?
Thank you ~
------Optimal Solution--------------------
In the string represented by the {variable} to refer to the value of a variable, of course, most of the cases do not increase the parentheses can be used normally, but with curly braces is a good habit
------Other Solutions--------------------
is to declare that this is a variable, because sometimes the "and" mix will go wrong, thus avoiding
------Other Solutions--------------------
This is basically used to surround variables, and it's safe to allow variables to be used as real variables in a string.
------Other Solutions--------------------
The difference is not small, one is not wearing a helmet to repair the house, one is wearing a helmet to repair the house!!
------Other Solutions--------------------
The content enclosed by curly braces "{}" represents a whole
Wherever possible ambiguity should be enclosed in curly braces "{}"
such as the code in your example, the multiple lines of code in a conditional statement branch, and so on.
------Other Solutions--------------------
{} is actually a chunk, a whole.
------Other Solutions--------------------
This has nothing to do with SQL, everyone upstairs explained.
------Other Solutions--------------------
There seems to be little relationship.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.