Jump to content

[SOLVED] Make these IF statements scaleable


tontox5

Recommended Posts

This is part of a mysql query, and I just can't figure out how to make it scaleable. Anyone got ideas?

 

if ($word_count==1) $boolean_query = "('+$search_words[0]*' IN BOOLEAN MODE)";
if ($word_count==2) $boolean_query = "('+$search_words[0]* +$search_words[1]*' IN BOOLEAN MODE)";
if ($word_count==3) $boolean_query = "('+$search_words[0]* +$search_words[1]* +$search_words[2]*' IN BOOLEAN MODE)";
if ($word_count==4) $boolean_query = "('+$search_words[0]* +$search_words[1]* +$search_words[2]* +$search_words[3]*' IN BOOLEAN MODE)";
if ($word_count==5) $boolean_query = "('+$search_words[0]* +$search_words[1]* +$search_words[2]* +$search_words[3]* +$search_words[4]*' IN BOOLEAN MODE)";

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.