• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

AnswerTeller

Get the Answer!

  • APPEARANCE
    • Hair
    • Skin
      • Tattoo
      • Piercing
    • Breasts
    • Makeup
    • Clothing
      • Lingerie
    • Shoes
    • Fashion
  • RELATIONS
    • Dating
    • Love
    • Friendship
    • Sex
    • Family
      • Husband
      • Wife
      • Parents
      • Brother
      • Sister
      • Children
    • Marriage
    • Divorce
    • Teenagers
    • Gifts
  • HOME
    • House
    • Apartment
    • Renting
    • Cooking
    • Garden
    • Pets and Animals
    • Car
    • Bikes
  • HEALTH
    • Maternity
  • LEARNING
    • School
    • College
    • University
    • Education
    • Exams
    • Maths
      • Algebra
      • Geometry
    • Physics
    • Chemistry
    • Anatomy
    • Quiz
  • KNOWLEDGE
    • Life
    • Religion
      • Bible
    • Books
    • History
    • Law
      • Crime
    • Science
    • Economics
    • Politics
    • International
    • Languages
  • WORK
    • Careers
    • Jobs
    • Interview
    • Business
    • Real Estate
    • Office
  • MONEY
    • Credit
    • Loan
    • Buying
    • Selling
    • Shopping
    • Insurance
    • Taxes
    • Stocks
    • E-Money
    • Gambling
    • Scam
  • LEISURE
    • Entertainment
      • Home Cinema
    • Celebrities
    • Sports
    • Movies
    • Music
    • Dancing
      • Ballet
    • Dining Out
      • Restaurants
      • Fast Food
    • Vacations
    • Holidays
      • Christmas
      • New Year
      • Easter
      • Halloween
    • Photography
  • TRAVEL
    • Accommodation
      • Hotels
      • Motels
    • Flights
    • Airlines
    • Trains
  • TRIVIA
    • Fortune
      • Horoscope
    • How To
    • How Do I
    • Puzzle
    • Quiz
    • Miscellaneous
Browse: Home / WORK / Real Estate

php/mysql “user inputed.. search field” HELP???

john i: php/mysql “user inputed.. search field” HELP???
For the life of me I can not find any help(tutorial) or script.. on how to create a working “user-inputed” search field that would search the working website and a Mysql database. I’m trying to build a “Real Estate” website and incorporate a search function that would be able to search through the listings that I would add to the database. I’ve spent the last two days looking at everything I could find on the web but, I got nothing that seems to work.. If anyone knows what I’m attempting to do and could offer some help.. I’ll take it.

Thanks, John.

Answers and Views:

Answer by james_007_400101
i would suggest implementing lucene its an open source project, you can search any possible thing with it using your database or web. We had implemented it successfully to search for books in our database. Its pretty fast give it a try.

Answer by BlueBoden
I would like to suggest you simply integrate google search, since that would free up resources on your own server. See: https://support.google.com/adsense/bin/answer.py?hl=en&answer=9879&topic=1705820&rd=2

But let me give you a very basic search function, using PHP/ MySQL
—–StartCode—–
if ((isset($ _POST[‘Search_String’])) && (preg_match(“/^[æøåÆØÅws]{3,24}$ /D”, $ _POST[‘usertext’]))) {
$ Search_String = $ _POST[‘usertext’];
} else { echo ‘Invalid Input’; exit(); }

$ Select_Content = mysql_query(“SELECT * FROM Content_Table WHERE TYPE = ‘C'”, $ Connection);
while ($ Get_Content = mysql_fetch_array($ Select_Content, MYSQL_ASSOC)) {
if (preg_match(“/” . $ Search_String . “/i”, $ Get_Content[‘CText’])) {
echo ‘

Match:’ . $ Get_Content[‘PostTitle’] . ‘

‘;
}
—–CodeEnd—–

The above will only provide absolute basic search functionality. Creating a working site-search can take anywhere between hours to months of development, depending on the complexity. Regular expressions plays a huge role, some search engines even allow the users to use regular expressions in their search strings.

It should however be easy to extend this to cut, and emphasize any matching text, say 20 characters in each direction from the match. Or whatever you want, php has some build-in functions to deal with this.

Related Questions:

  • 1.  Near Joplin Mo – 2 Homes 4 Sale?
  • 2.  What constitutes a breach of real estate “contract for purchase”.?
  • 3.  Backing out of real estate purchase agreement?
  • 4.  What is the difference between buying coop and condo?

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Categories

  • APPEARANCE
    • Breasts
    • Clothing
      • Lingerie
    • Fashion
    • Hair
    • Makeup
    • Shoes
    • Skin
      • Piercing
      • Tattoo
  • COMPUTER
    • Computing
    • Hardware
    • Internet
      • Google
      • Networking
      • Spam
      • Yahoo
    • Microsoft
    • Programming
    • Software
  • HEALTH
    • Maternity
  • HOME
    • Apartment
    • Bikes
    • Car
    • Cooking
    • Garden
    • House
    • Pets and Animals
    • Renting
  • KNOWLEDGE
    • Books
    • Economics
    • History
    • International
    • Languages
    • Law
      • Crime
    • Life
    • Politics
    • Religion
      • Bible
    • Science
  • LEARNING
    • Anatomy
    • Chemistry
    • College
    • Education
    • Exams
    • Maths
      • Algebra
      • Geometry
    • Physics
    • School
    • University
  • LEISURE
    • Celebrities
    • Dancing
      • Ballet
    • Dining Out
      • Fast Food
      • Restaurants
    • Entertainment
      • Home Cinema
    • Holidays
      • Christmas
      • Easter
      • Halloween
      • New Year
    • Movies
    • Music
    • Photography
    • Sports
    • Vacations
  • MONEY
    • Buying
    • Credit
    • E-Money
    • Gambling
    • Insurance
    • Loan
    • Scam
    • Selling
    • Shopping
    • Stocks
    • Taxes
  • Popular Questions
  • RELATIONS
    • Dating
    • Divorce
    • Family
      • Brother
      • Children
      • Husband
      • Parents
      • Sister
      • Wife
    • Friendship
    • Gifts
    • Love
    • Marriage
    • Sex
    • Teenagers
  • TRAVEL
    • Accommodation
      • Hotels
      • Motels
    • Airlines
    • Flights
    • Trains
  • TRIVIA
    • Fortune
    • Horoscope
    • How Do I
    • How To
    • Miscellaneous
    • Puzzle
    • Quiz
  • WORK
    • Business
    • Careers
    • Interview
    • Jobs
    • Office
    • Real Estate

Search for More!

Copyright AnswerTeller © 2025 · About · Privacy Policy · Contacts · Sitemap Disclaimer: AnswerTeller.com is an informational website, and its content does not constitute professional advice of any kind. As an Amazon Associate, we earn from qualifying purchases.