[DiscuzX2.5] Itisnotsafetodothisquery query does not allow quotation marks for secondary development for discuzX2.5. what should I do when you look up your own table or query a string username ??? Currently, I use: DB: query ('select * fromt [discuz X2.5] It is not safe to do this query. quotation marks are not allowed.
You have made secondary development for discuzX2.5. how do you deal with this problem when you are querying your own table or querying a string username ???
Currently, I use: DB: query ('select * from t_username where f_username = "'. $ username .'"');
I found that errors will occur as long as the SQL statement contains quotation marks. Ask everyone how to write SQL statements to query their own tables.
------ Solution --------------------
'"Change it.
------ Solution --------------------
DB: query ("select * from t_username where f_username = '$ username '");
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service