I'm trying to select categories without duplicates from 2 different columns, the table looks something like this:
cuisine_1 cuisine_2
----------------------
italian french
italian chinese
japanese german
western
french german
international
western sushi
sushi steak
steak
chinese
vietnamese chinese
Expected result is every category only once where it doesn't matter if it came from cuisine_1
or cuisine_2
I tried like so:
$categories=mysqli_query($link,"select distinct cuisine_1,cuisine_2 AS cuisine_unique from table");
while($row_cu=mysqli_fetch_array($categories)){
echo $row_cu['cuisine_unique']."<br>";
}
Without any luck so far. Do I have to group the results first, or what am I doing wrong ?