dagon;10935576 wrote:I'm really unclear what you want at this stage.
Sorry for my poor expression here...
The condition is like this:
I got the arrays from 2 search:
$result1=mysql_query("select * from listing where title='%".$keyword."%'");
$result1 will generate data such as:
array(2) {
[0]=>
array(93) {
["id"]=>
string(2) "26"
["listing_id"]=>
string(2) "26"
["last_modify"]=>
string(2) "2009-09-20"
}
[1]=>
array(93) {
["id"]=>
string(4) "4129"
[COLOR="Red"] ["listing_id"]=>
string(4) "4129"[/COLOR]
["last_modify"]=>
string(2) "2009-11-28"
}
}
$result2=mysql_query("select * from product where product_name='%".$keyword."%'");
$result2 will generate data such as:
array(2) {
[0]=>
array(93) {
["id"]=>
string(2) "288"
["listing_id"]=>
string(2) "288"
["last_modify"]=>
string(2) "2009-10-20"
}
[1]=>
array(93) {
["id"]=>
string(4) "4129"
[COLOR="Red"] ["listing_id"]=>
string(4) "4129"[/COLOR]
["last_modify"]=>
string(2) "2009-09-30"
}
}
So the search result will be:
$result=$result1.$result2;
However, I don't want to echo the same data twice as you see the both results contains listing_id = 4129
So i thinking is there any way I can remove the duplicated data from the merged array $result
I'll keep trying for the solution and hope to update the status here later.
Thank you!