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

  • SEARCH
  • Home
  • 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 6000625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:43:14+00:00 2026-05-23T00:43:14+00:00

My users can search for an order by an address right now. What I

  • 0

My users can search for an order by an address right now. What I would like to do is let them be able to search with multiple criteria. Let them search by address, city, state, etc etc.

I have tried using the following code, but it doesn’t seem to work.

$sql = ("SELECT order_number, sitestreet FROM  `PropertyInfo` WHERE  `sitestreet` LIKE '%$street%' OR `sitecity` LIKE '%$city%' AND `user` LIKE '$user'");

$result = mysql_query($sql);

I don’t think it’s reading the value in $user cause it displays all orders for all users.

How can I make it possible to search for an order using multiple serach values?

Thank you!

  • 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-05-23T00:43:15+00:00Added an answer on May 23, 2026 at 12:43 am

    Wrap your OR statements in parenthesis so it forms one top-level condition, the user is the other top-level condition:

    $sql = '
      SELECT 
        `order_number`, 
        `sitestreet` 
      FROM  
        `PropertyInfo` 
      WHERE  
         (
            `sitestreet` LIKE "%'.$street.'%" OR 
            `sitecity` LIKE "%'.$city.'%"
         ) AND 
         `user` = '.$user;
    

    Also note, you want a direct match to the user column, use = instead of LIKE. I am assuming that $user is a numeric ID…

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

Sidebar

Related Questions

Let's say I have a form where users can search for people whose name
Using System.Net.HttpRequest I would like to imitate a users search on the following search
Imagine I've got a database with lots of data, from which users can search.
I'm using a MySQL database. I have a products database where users can search
On my website users can keyword search and find desired results. (Just a simple
I am wanting to allow users to tag items so that they can search
I'm creating video music search in android WebView and I wanted users can launch
How can I use a a search filter to display users of a specific
I'm currently developing a website where users can search for other users based on
I'm trying to get all users, and order them by a field on another

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.