See someone else's code,
'SELECT '.$param['field'].' FROM `'.DBPRE.$param['table']
What does the sign from the back of the function do?
Reply content:
See someone else's code,
'SELECT '.$param['field'].' FROM `'.DBPRE.$param['table']
What does the sign from the back of the function do?
All databases have similar settings, but MySQL uses ' just '. This is typically used to describe the database name, table name, and field name. For example
select from from table;
The first from is the field name, the last table is also the field name, but it is also the MySQL keyword, so the execution will be error, so you should use
select `from` from `table`
Of course, for readability, it is not recommended to use the keyword as the field name, the table name, and the database name, table name, field name should be included in a pair of anti-quotes.
Avoid conflict with the keyword, is to tell MySQL inside is a normal string, not what command
Avoid conflicts with MySQL's own keyword, so use this notation, although sometimes it doesn't affect the query but it's better to add it.