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 8557967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:41:50+00:00 2026-06-11T15:41:50+00:00

i am working on a search system in which a person is searched by

  • 0

i am working on a search system in which a person is searched by country and their firstname and the last name. For the First and Last name i used concatbut using it with further and condition doesn’t seems to work. my query is

select * from users_profile where CONCAT(fname,' ',lname) like '%v %'
or Email like '%v %' AND country='india'

in the above if ise use the query without “and” it works . but i need to specify more conditions and if i simply use and without concat that also works .

select * from users_profile where CONCAT(fname,' ',lname) like '%v %'
or Email like '%v %'

how to make it work with both concat and further and condition i want to apply.

  • 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-11T15:41:51+00:00Added an answer on June 11, 2026 at 3:41 pm

    You should not be using CONCAT, let alone any functions around your WHERE columns. Further, you should be specifying a column list, not SELECT *. Also check your order of criteria.

    You can try something like this:

    SELECT fullname, Email, country
    FROM
        (SELECT CONCAT(fname, ' ', lname) AS fullname, Email, country FROM users_profile) a
    WHERE (a.fullname LIKE '%v %' OR Email LIKE '%v ') AND country = 'india'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an issue management system, developed in PHP/MySQL. It requires search
I am altering the question now! I have the search working using the following:
I'm working on an offline only help system which requires loading a large amount
I'm working on a program which uses the System.Diagnostics.Debugger.Break() method to allow the user
I am working with a CMS like system, phpBMS, which defines a certain way
I am working within the confines of a php based CMS like system, which
I have a form which I'm using jQuery to post and working to handle
I have created a login system in codeigniter project, which is working fine in
I inherited a program which is using Windows Desktop Search (WDS) on a remote
I am using a search library which advises keeping search handle object open for

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.