Jump to content

need help on filter


HAVOCWIZARD

Recommended Posts

how do the filter work, doesnt filter my query, can anybody help pls

while ($result = mysql_fetch_array( $data))
					{ 
						echo($result['register_companyName']);
						$keywords = rtrim($keywords,$find1);
						$result = array_filter($result,$keywords.$keywords);
					}

i get my results, then i want to filter everything with the $find1, how does this filter word,

 

 

Link to comment
https://forums.phpfreaks.com/topic/55422-need-help-on-filter/
Share on other sites

Well to start the function rtrim(); is to filter white space, not sure if it is what you want based on your second query there, PHP Manual - RTRIM.

 

Also I need a clarification. What exactly is the point of the filter, to find the keywords in the query and if found return them? Is this part of a search script?

Link to comment
https://forums.phpfreaks.com/topic/55422-need-help-on-filter/#findComment-273897
Share on other sites

yes , what i do is i have the explode on the seach string, so explode them in x amount of words, then i search each word in database, if one of the words are found i then do the adding and removing the words found then i only have the result let say, america, now is filter the leftover words that i have joint aas you can see, "big burgers", so that i can get the result in america for big burgers, is very confusing i know, got everything right upto the filter, doesnt filter, or i am doing it wrong giving me callback error and then something else if i change it, can we query a query, problably not, lol, thanks for the help...

Link to comment
https://forums.phpfreaks.com/topic/55422-need-help-on-filter/#findComment-273908
Share on other sites

Well I still don't totally understand you but keep in mind you can do something like this if your looking for a keyword search:

 

<?php

$keyword = $_POST['keyword'];

myConnectToDatabaseFunction();

$sql = mysql_query( "SELECT * FROM myTable WHERE myColumn LIKE '%$keyword%'" );

while( $row = mysql_fetch_array( $sql ) ){
   
   $myVariable = $row['myDBvariable'];

   echo( $myVariable );

}

?>

 

That will perform a LIKE wildcard search on the specified coulmn of the DB. So if you type in America, for example, it will return all the rows in the database where America is in that column. You can then manipulate them from there, I chose an echo.

Link to comment
https://forums.phpfreaks.com/topic/55422-need-help-on-filter/#findComment-274096
Share on other sites

that is what i am doing , query the "america", but remeber i do a exact match, so when the search string is " big burger america" i wouldnt find it so, i explode, search each word, then the words not used in the search filter the result on those words, that will be big burger, let say like i search for "car wash pretoria", nothing is listed as that, and nothing is as car or as wash, so i add the words, doing all posibilities and then search, but i will find pretoria, listed as suburb, so i just need to filter the query, stuck on this the whole day, because i can rerun the query on car wash how will i find the correct row with all the search string, wish there was an easier way,it waas so easy to do in delphi lol. any ideas

Link to comment
https://forums.phpfreaks.com/topic/55422-need-help-on-filter/#findComment-274160
Share on other sites

how can i pass a value to a function, because i see that in the filter statement it calls the functions of odd, the it filters, i think lol, so if i can pass the value to the filter do another query then filter the 2 queries with each other then i should work, im confusing myself, any idea,

Link to comment
https://forums.phpfreaks.com/topic/55422-need-help-on-filter/#findComment-274164
Share on other sites

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.