Weak: one SQL statement, phpmyadmin can be executed, mysql console can be executed, but php execution reports an error

Source: Internet
Author: User
Weak explosion: one SQL statement, phpmyadmin can be executed, mysql console can be executed, php execution is reported wrong PHP execution & nbsp; said PhpMyadmin is not executed through this column & nbsp; mysql & nbsp; run SELECT & nbsp; userinfo. *, ofUser. email, ofUser. weak c explosion: an SQL statement that can be executed by phpmyadmin, mysql console, and php
PHP execution says there is no such column


PhpMyadmin runs through
 

Mysql runs through


SELECT userinfo. *, ofUser. email, ofUser. creationDate, ofUser. modificationDate FROM userinfo inner JOIN ofUser ON (userinfo. username = ofUser. username) WHERE 1 and (ofUser. creationDate> 1326816000000 and ofUser. creationDate <1327075200000) limit 0,100

For joint queries from two tables, the userinfo ofUser tables use username as the link and use it as the inline condition.
It is strange why PHP reports an error saying "Unknown column 'ofuser. creationdate' in 'where clause.
CreationDate is a varchar (15) that stores unix time strings, similar to 001356757981309 (in milliseconds)
However, you can directly compare them without using single quotes, because the results of PhpMyadmin and mysql are correct.

Phpmyadmin mysql php
------ Solution --------------------
In which table is the creationDate column?
------ Solution --------------------
Check whether all your tests are in the same environment?

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.