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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:09:22+00:00 2026-05-19T11:09:22+00:00

For the recipient field in my message system, if you enter Megan Fo, it

  • 0

For the recipient field in my message system, if you enter Megan Fo, it will ask you “Did you mean Megan Fox?”. Then I also have a “Who did you mean? Megan Fox, Megan Foxxy, Megan Foxxie” if there’s more than one found.

And then ofcourse there is if you made it correct. (if this SQL statement is returning 1 only out and the full is 1).

 SELECT users.id, users.firstname, users.lastname, 
 (users.firstname = 'Meg' AND users.lastname = 'Meg') AS full FROM users 
  INNER JOIN users_friends ON users.id=users_friends.uID
  WHERE users_friends.bID='1' AND users_friends.type = 'friend' AND users_friends.accepted = '1' AND (
 (users.firstname = 'Meg' AND users.lastname='Meg') OR
 (users.firstname LIKE 'Meg%' AND users.lastname LIKE 'Meg%') OR
 users.firstname LIKE 'Meg%' OR
 users.lastname LIKE 'Meg%')

This is working fine, although now I am having an issue when Im trying to send to a user

“Meg Meg”

Then it returns 2, “Meg Meg” and “Megan Fox”. I want it to return one only if it matchs the full. So now I am keep getting “Who did you mean?” as i build it up so if thers more than 1 rowcount, then “who did you mean..”

if($sql_findUser->rowCount() == 1){
 $get = $sql_findUser->fetch();
    if($get["full"] == 1){
echo "SUCCESS, ONE FOUND FULL MATCH"
}else{
echo "Did you mean ...?"
}
}elseif($sql_findUser->rowCount()>1){
Who did you mean?
}

How can i fix this?

  • 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-19T11:09:23+00:00Added an answer on May 19, 2026 at 11:09 am

    At the end of your SQL statement, it looks like you’re including everyone with a first name starting with “Meg”, which is why Meg Meg and Megan Fox both match. Try shortening your WHERE clause to:

        WHERE users_friends.bID='1' AND users_friends.type = 'friend' AND users_friends.accepted = '1' AND (
    (users.firstname = 'Meg' AND users.lastname='Meg') OR
    (users.firstname LIKE 'Meg%' AND users.lastname LIKE 'Meg%')) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Message.xaml file that should display a recipient field and a message
When I subscribe as the recipient of a certain type of message using NServiceBus
I have this in a MySQL db: table Message sender_id int recipient_id int created
Does anybody know how to capture the message that a sender sends the recipient
I try to send a sms using next code, but recipient gets my message
I'm looking for a distributed message queue that will support millions of queues, with
I have a private message model that relates to two users, how do I
Possible Duplicate: PHP Mail, CC Field I have the task of adding a CC
I have in model Invitation a field and attribute like: field :recipients, :type =>
I have the following string: <script>m('02:29:1467301/>Sender1*>some text message?<<02:29:13625N1/>Sender2*>Recipient2: another message??<>A<<02:29:1393100=>User1*|0User2*|%></B><<','');</script> N.B. messages are separated

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.