HAVOCWIZARD Posted May 22, 2007 Share Posted May 22, 2007 hi all still new at this cant get the commands to work, have a query and im trying to filter or compare or anything that will only give me one result of the record that have the spesific words in, im running a full search... // strings to remove from lists $removal_strings = array("(", ")", "[", "]"); // create sql query for search $sql_query = "select register_companyName from $register_table where "; $sql_query .= "MATCH (register_companyName, register_Mcat, register_keyword1, register_keyword2, register_keyword3, register_keyword4, register_keyword5, register_keyword6, register_keyword7, register_keyword8, register_keyword9, register_keyword10, register_area, register_suburb, register_province, register_country)"; $sql_query .= "AGAINST ('" . $_POST["inputTxt"] . " in boolean mode');"; $search_full = rundbquery($sql_query); $words = addslashes(str_replace($removal_strings, "", $_POST["inputTxt"])); $found = explode(" ", $words); $found1 = $found[0]; $found2 = $found[1]; ******************************************************** while($found1 = $search_full) { printr ($found); printr ($search_full); } ***********************************************************8 dont work just loops i have tride to filter nothing what is wrong, if anybody can help pls...the problem is where the ** are.. thanks Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/ Share on other sites More sharing options...
georg Posted May 22, 2007 Share Posted May 22, 2007 Is there any errror displayed? afaik you can only use "MATCH" If you've definded an index... what kind of data does rundbquery($sql) return? maybe use $found1=mysql_fetch_object($search_full); Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/#findComment-258958 Share on other sites More sharing options...
hitman6003 Posted May 22, 2007 Share Posted May 22, 2007 Make sure you have a full text index on all columns you are using in your MATCH query. Also, check to see what rundbquery() does on an error...does it just return? Does it throw an error, but continue execution? Does it stop execution? If in doubt, use mysql_query() with a die on the end. $search_full = mysql_query($sql_query) or die(mysql_error()); What does rundbquery() return? An object? An array? Your while loop is infinite...you will always be able to set one var equal to another...you want something like: while ($found1 = mysql_fetch_assoc($search_full)) { printr ($found); printr ($search_full); } or foreach ($search_full as $found1) { printr ($found); printr ($search_full); } Depending on what your rundbquery returns (a mysql object, a set of object rows, or an array). Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/#findComment-258963 Share on other sites More sharing options...
HAVOCWIZARD Posted May 22, 2007 Author Share Posted May 22, 2007 have full index runs in the loop like i ceated gives me result of all the words[0] and word[1] need to macth the record on only both let me quickly test that as function www.search4us.co.za/search1.php here is the link to it Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/#findComment-258969 Share on other sites More sharing options...
HAVOCWIZARD Posted May 22, 2007 Author Share Posted May 22, 2007 thanks that first one worked, now i need to filter the result form that, search "game hoedspruit", so if the record has all these words then it should display it.... i can see again the loop is gone lol, thanks...now the compare or filter , what will work the best ? Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/#findComment-258976 Share on other sites More sharing options...
jitesh Posted May 22, 2007 Share Posted May 22, 2007 Format will be like this (match(UrlKeyWord.Keyword) against('keyword1') OR match(keyword) against('*keyword1' IN BOOLEAN MODE)) OR (match(UrlKeyWord.Keyword) against('keyword2') OR match(keyword) against('*keyword2' IN BOOLEAN MODE)) OR (match(UrlKeyWord.Keyword) against('keyword3') OR match(keyword) against('*keyword3' IN BOOLEAN MODE)) Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/#findComment-258977 Share on other sites More sharing options...
HAVOCWIZARD Posted May 22, 2007 Author Share Posted May 22, 2007 now u lost me where should this cum in....remeber both words should be true to that record else skip record and dont display... Quote Link to comment https://forums.phpfreaks.com/topic/52479-need-help-with-query-result-compare-or-something/#findComment-258982 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.