hi-
i am adding and and or operators to a search engine i will have hooked
up to my personal bookmarks on my website. i wanted to get rid of
duplicate
page_url when i chain the conditions together like
tcl or delphi or sqlite returns:
http://j_m_mc.tripod.com 12
http://www.dubaron.com 11
http://www.dubaron.com 4
http://j_m_mc.tripod.com 3
probably the correct thing to do is add the occurrence number together
and omit a url. so one url is listed with the sum of the occurrence.
right now i'd be happy with getting rid of the duplicate and having the
occurrence be a little off. i'll think about tackling accurate
occurrence later.
i think the problem in my code is when i call in_array() it is not
finding the url (EVER). what i wanted to do is create an array and push
a url onto
this new array every time that url is not found. if it is found then my
code takes a different action. this way (i thought) duplicate urls dont
get displayed.
here is my code...thanks for any help.
jim
$unique = array ('init');
reset($or_sql);
reset($and_sql);
$ar_merge=array_merge($or_sql,$and_sql);
while($array_cell = each($ar_merge))
{
$current_value = $array_cell[0];
$current_key = $array_cell[1];
if ($array_cell[1] !=' ') {
while ($row = mysql_fetch_array($array_cell[1])) {
if (in_array($row[0],$unique)) {
} else {
print( "$row[0] $row[1] </br> ");
// store in array
Array_push($unique,$row[0]);
}
}
}