Jump to content

searching across multiple columns


1internet

Recommended Posts

I am trying to create a search form with one field that will search through one table, but through all the columns. I just can't seem to work it out. Also is there some way to prioritize the results, e.g. if the keyword is in the title then rank it above the results that have the keyword in the description?

Link to comment
https://forums.phpfreaks.com/topic/273403-searching-across-multiple-columns/
Share on other sites

I just can't seem to work it out.

 

then you might want to take a better look at the select query http://dev.mysql.com.../en/select.html and especially the WHERE statement

 

Also is there some way to prioritize the results, e.g. if the keyword is in the title then rank it above the results that have the keyword in the description?
there is, obviously

I understand WHERE statments, but I just don't know what the query would be if I wanted to search multiple fields.

WHERE `firstName` LIKE '%".$searchFirstName."%, but what if I wanted to search other fields, and how do I priortize one over the other, without duplicate entries?

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.