Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8845139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:39:53+00:00 2026-06-14T11:39:53+00:00

I have a search query which dynamically adds the search parameter LIKE %keyword% to

  • 0

I have a search query which dynamically adds the search parameter LIKE “%keyword%” to the query. My question is: is the order of the search parameter important?

Say I have 4 records in my database.

1. 2012 bmw 335,
2. 2013 bmw x3,
3. 2012 audi a4,
4. 2012 Benz clk

When I searched for 2012 bmw x3, the result returned record 1,3,and 4 but not record 2. I would except the search to return all 4 records. Why is this happening? I use “OR” to link each of the search parameter.

Here is my query:

SELECT * 
FROM for_sale 
WHERE message LIKE "%2012%" OR "%bmw%" OR "%x3%"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:39:54+00:00Added an answer on June 14, 2026 at 11:39 am
    SELECT * 
    FROM for_sale 
    WHERE message LIKE "%2012%" OR message LIKE "%bmw%" OR message LIKE "%x3%"
    

    This is what you’re after – remember that OR doesn’t bind to LIKE possibilities!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a search script which logs every search query in a MySQL database
I have a database search query which search in the database for a word
I have a T-SQL query as below which queries a table holding the search
I have a script which allows to display search results. Given a query there
I have a search page like <div class=> <input id=search-input type=text class=input-medium search-query span4>
i have a search query which will retrieve information from 3 tables i made
I have written a query which will perform Full Text search using full search
I have a web service with this form: http://<remote_domain_ip>/api/v1/search/?query=the_query Which results a JSON document
I have a SQL Search Query which works if I search on the First
I have a search query which yields a resultset based on input parameters and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.