ThinkPHP framework questions about whether a database value exists

Source: Internet
Author: User
The ThinkPHP framework wants to log on to the system to check whether the database has a certain value. but if I submit the previously registered data, the output is always "where ()". how can I change it? My database account is & nbsp; account_number ThinkPHP framework. Is there a value in the database?



I just want to create a login system, but submitting the previously registered output is always





Is there a problem with where ()? how can I change it?

My database account is account_number
Share:
------ Solution --------------------
Where ('account _ number = $ username ')
Writing at least
Where ("account_number = $ username ")
Considering that $ username may not be a pure number
Therefore, writing
Where ("account_number = '$ username '")
Or
Where (array ('account _ number' => $ username ))

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.