如何打印groupcat函数的输出


how to print the output of group_concat function

如何打印此查询的输出:

 $NOTicoun=mysqli_query($conn,"select group_concat(distinct session_id) 
 from fk_views where comment !='' and onid='3738'");

我尝试过:mysqli_data_seek,但结果设置不理想。在php的早期版本中,我们可以使用mysql_result函数,但在这个版本的php中不可用。

您可以使用Alias

select group_concat(distinct session_id) as yourAlias

然后获取关联数组并使用访问它

$row['yourAlias']

当然还有其他方法