如何获得选择列值的一维数组

时间:2019-03-09 20:04:08

标签: php mysql

users-列nick

SKY NIGHT BLACK PAPER GOLD LINE

$st = $db->query("select nick from users order by nick asc");
$st->execute();
$nicks = $st->fetchAll();
print_r($nicks);

结果:

Array ( [0] => Array ( [nick] => BLACK PAPER [0] => BLACK PAPER ) [1] => Array ( [nick] => GOLD LINE [0] => GOLD LINE ) [2] => Array ( [nick] => NIGHT [0] => NIGHT ) [3] => Array ( [nick] => SKY [0] => SKY ))

如何获得此结果:

Array("BLACK PAPER","GOLD LINE","NIGHT","SKY"); 

0 个答案:

没有答案