$arr2=array();
$query3 = "SELECT user_name from USER where user_priv='$USER_PRIV' ";
$cursor3= mysql_query($connection,$query3);
while($row3=mysql_fetch_array($cursor3)){
$arr2[]=$row3['user_name'];
}
$arr2=implode(",",$arr2);
php把从数据库读取出来的数据存放到数组里的代码如上,
结果数组如果想要插入数据库或者导出到excel处理,是不能直接使用的,要先转为字符串哦。