Jump to content

Search Functions ?


Accurax

Recommended Posts

I'm about to start building some search functionality into my site tomorrow morning, now, im pretty sure that i have the basics down, but correct my musins is they are wrong;

1) create a form that allows the user to select or de-select search critera and submit it.

2) Have an sql querey that covers all of the possible search criteria eg;
[code]
SELECT user FROM members WHERE hobbies='$hobbies' && fruit='$fruit' ... && ......... && ...... && etc etc etc ....

[/code]

This is really my first question;

Can i us just one sql statement even though some of the search criterai may in fact be left empty in some searches?
Will the SQL just ignore these empty variables?

Secondly im a little confused as to how i could make my results display accross multiple pages, sat a search querey returned 500 results, id like to show these on 10 consequtive pages of 50 results each .... ive seen this done, but can neither figure it out in my head, or find a cod example on the good ole tinternet.

Any and all advice is appreciated guys
Link to comment
https://forums.phpfreaks.com/topic/32903-search-functions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.