Jump to content

Text Form String Help Please


paulmo

Recommended Posts

jsg you helped me with the user text form string variable which becomes $word, but it is only getting searched on last word in string against db, wheras I need any and [mostly] every word in string searched, in any order. for example "hot water" gets match because 'water' is in db table, but 'water hot' is returning no results. thank you!!

$message = mysql_real_escape_string($message); $message = strip_tags($message); $name = trim($name); $name = strip_tags($name); $name = mysql_real_escape_string($name); $pre_filter=trim($message);$get_search=explode(" ",$pre_filter);$post_message = stripslashes($post_message);$name = $_POST['name'];$post_name = ucfirst($name);echo "Message: {$post_message}<p>";$where = '';$common = array('they', 'this', 'that', 'them', 'those', 'your',);foreach ($get_search as $word){$word = trim($word);

Link to comment
Share on other sites

thanks jsg...it's got to be my query...someone suggested a join. can you get me started please? one table; $word gets matched to column 'good'; if match, $word gets matched to column 'keyword'; match on 'keyword' echoes same row in 'echo_good' column to user (keyword id = echo_good id).if no match on 'good', match against column 'bad' etc.if no match on good or bad but match on 'keyword', echo message to user to elaborate on keyword match.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...