Jump to content


Photo

A search tutorial?


  • Please log in to reply
3 replies to this topic

#1 Mr Chris

Mr Chris
  • Members
  • PipPipPip
  • Advanced Member
  • 336 posts

Posted 24 August 2006 - 01:54 PM

Hi Guys,

I'm looking for a search tutorial to help me understand how I could explore the possibility of building a search page with fields, such as:

http://jobsearch.monster.co.uk/
http://www.fish4.co....d/jobs/advanced
http://www.primeloca...perty-for-sale/

Could anyone point me in the direction of any URLS?

Many Thanks

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 24 August 2006 - 02:04 PM

I don't have any URLs specifically... but it really comes down to understanding your database and how to use SQL effectively.  If you know those 2 things and how to build a simple HTML form and display the results, then you're all set.  If you don't understand the display part, do a search or look at the tutorials on our main site: www.phpfreaks.com  This has been covered literally hundreds of times.

Info: PHP Manual


#3 Mr Chris

Mr Chris
  • Members
  • PipPipPip
  • Advanced Member
  • 336 posts

Posted 24 August 2006 - 02:25 PM

Thanks,

I do understand PHP & Mysql quite well, but I'm not sure about searching a database with conditions.

For example I know how to write a simple php form and output the results back on a page when submit is hit - that's NOT linked to a Mysql database.

But for example, if I had a form and I was searching for a Car ie: 'Seat Ibiza'

i'm not sure how to:

1) Get the form to look in the database and return all results from rows where make='seat_ibiza'.

Then also on these forms there will be other conditions, ie searching for a 'seat ibiza' that is 'red'

2)So I need some kind of tutorial with IF/else statements to show how to achieve something like this.

See what I mean?  Any tutorial links for anything like this will be handy if you could post them please people? In the meantime i'll look through phpfreaks tutorials.

Many Thanks

Chris

#4 True`Logic

True`Logic
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 24 August 2006 - 03:21 PM

just make a lil bool isin() function using mid() to automatically check a passage of text for the queried string, i think PhP migh thave such a function built in, but im not quite sure.. if not, it's quite easy to make and seems to me to be self explanitroy, then jus torganise your database in a numerical fassion and use a little for() { } or while() { } loop to search database 1 entry at a time for if(isin(current_cell, $_GET["query"]))


hope this helped... works better and much easier with Ini's than SqL Db's i think




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users