I have try to remove duplicated post with array_unique but seems not work in this way, i have try to add array_unique($array) after while but it's back me only one result, record_num is ID.
while($row = mysql_fetch_assoc($result)) {
$array[] = $row;
}
array_unique($array)
foreach($array as $row) {
.....
}
Array example
Array
(
[0] => Array
(
[record_num] => 18152
[title] => Title of post
)
[1] => Array
(
[record_num] => 18150
[title] => Title of post 2
)
[2] => Array
(
[record_num] => 18134
[title] => Title of post 3
)
[3] => Array
(
[record_num] => 18134
[title] => Title of post 3
)
}