我正在尝试从2个不同的列中选择没有重复的类别,该表看起来像这样:
cuisine_1 cuisine_2
----------------------
italian french
italian chinese
japanese german
western
french german
international
western sushi
sushi steak
steak
chinese
vietnamese chinese
如果来自cuisine_1
或cuisine_2
我试过这样:
$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>";
}
到目前为止没有任何运气。我是否必须先对结果进行分组,或者我做错了什么?