Jump to content

Advanced Search


marcs910

Recommended Posts

Still a newb as I have dropped off the hp wagon for a couple of months.

 

Here's my question. Im looking to do one of the more advanced searches where you have a form you can narrow the search by username, user type, date entered, etc.

 

Everywhere I've looked all I can find is the basic searches. Can someone point me in the right direction or show me some code please.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/45552-advanced-search/
Share on other sites

On your search form you might have a drop down box with a list of:

Username

User Type

Data

 

 

When they select one and do the search, in your SQL query you just need to change the WHERE statement to the above, so

 

Very rough idea:

$search_type = $_POST['type']; // From the drop down box form

$sql = "SELECT.......... WHERE $search_type = '%SEARCHKEYWORDS%';

Link to comment
https://forums.phpfreaks.com/topic/45552-advanced-search/#findComment-221151
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.