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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:45:09+00:00 2026-06-12T02:45:09+00:00

In my code i want to search the friends by its firstname , lastname

  • 0

In my code i want to search the friends by its firstname , lastname and by a email fields.
Now i want to match the exact string from the database table fields name.also i want to display that fields.also i want get the search data`s id so then after i will display the full description about that person.how can i do it.
thanks any help for me.
i try it.

$term=$_POST['find'];
$searchquery=mysql_query("select firstname,lastname,email from account where output LIKE %$term%");
  • 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-12T02:45:11+00:00Added an answer on June 12, 2026 at 2:45 am

    You are looking for :

    SELECT id, firstname, lastname, email
    FROM account
    WHERE firstname LIKE %$term%
    OR lastname LIKE %$term%
    OR email LIKE %$term%
    LIMIT 20
    

    Note that your way is potentially dangerous, you should protect your $term variable :

    $term = mysql_real_escape_string($_POST['find']);
    

    Anso note that mysql_* family function is under deprecation process, you should have a look to PDO or mysqli.

    Edit:

    Added a LIMIT because I don’t think you want to recover all your database table if $term contains nothing.

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

Sidebar

Related Questions

I have written a code that searches specific string from database table.what i want
how to modify this code if i want search JD from var str=KD-S35JWD ..i
I am writing a java code. I want to search a string on google
I am new to developing code in iPhone, and I want to search some
I have a .csv file with code and description. I want to search the
I want to write a php code that can search for multiple keywords separated
I'm building a zip code search page for my Android app so I want
enter code here Want to remove items from a Main list , but give
I want to search a Lucene.net index for a stored url field. My code
Often when I want to search through my code in Visual Studio, I know

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.