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
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 Edited by stijn0713
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.