100, thinkphp fuzzy query problem, fuzzy query condition is array

Source: Internet
Author: User
100 points: the thinkphp fuzzy query problem. The fuzzy query condition is array 100 points. The values are urgent. the thinkphp fuzzy query problem. The fuzzy query condition is array.
$ Map2 ['ornamentations. tags'] = array ('like', array ("% $ a1 %", "% $ a2 %", "% $ a3 %"), 'or ');
The query condition should be the "and" relationship, but an error is reported when the "and" clause is written, and no results can be found.


Reply to discussion (solution)

Use $ map2 ['_ string'].

Use $ map2 ['_ string'].


What does this mean? Not understand

You need to enclose the condition % with single quotation marks. Otherwise, an error will be returned when it is assembled into an SQL statement.


Use $ map2 ['_ string'].


What does this mean? Not understand




Search for _ string in the thinkphp manual to find out what is going on. This means you can query the SQL statement you want.

An error is returned. output your SQL statement to check the SQL concatenation error.

$ Map ['_ string'] is used to assign the original where condition statement to this variable...

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.