Jump to content

Running seperate search queries against different columns of data with full-text


Recommended Posts

A very easy one here for you guys I'm sure.

 


        $sql = "SELECT id, name, author, dts, colour1, colour2, resolution, widescreen, description,
               MATCH(name, author, colour1, colour2, resolution, widescreen, description) 
               AGAINST ('$searchstring' IN BOOLEAN MODE) AS score FROM mytable 
               WHERE MATCH(name, author, colour1, colour2, resolution, widescreen, description) 
               AGAINST ('$searchstring' IN BOOLEAN MODE) ORDER BY score DESC
		   
";

 

I'd like to change that so that it searches the name/author/resolution/widescreen/description columns against $searchstring, and the colour1/colour2 columns against $searchcolourstring. I imagine its a very simple bit of syntax, but I just cant get it to work. Must be because it's late...

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.