I'm using php and mysql. I'm having a problem with my piece of code. I want to remove duplicates and output the unique ones.
.php code
$query = "SELECT * FROM blog_posts";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
echo $row['post_category'];
echo array_unique(explode(',', $var));
the table:
id(1) = post_category(CategoryA)
id(2) = post_category(CategoryB)
id(3) = post_category(CategoryC)
id(4) = post_category(CategoryA, CategoryB)
id(5) = post_category(CategoryB, CategoryC)
I'm about to create dynamic url links to every category