我使用组 concat 来连接 id,因为 uid uid 列被分组为 68,94,97,88,93,69,95 我想引用其他表并获取每个 id 的名称,为此我将数组分解为下面给出
我如何获得数组$arrurtype
中的?$row
$rs = mysqli_query($dbc,"SELECT A.* ,
GROUP_CONCAT( `B`.`uid` ) AS `uid`
FROM A
JOIN B
ON A.id = B.id
GROUP BYA.Section_Id limit $offset,$rows");
$items = array();
$i=0;
while($row = mysqli_fetch_object($rs))
{
$idSysUsers = $row->idSysUsers;
$exp = explode(',',$idSysUsers);
foreach($exp as $val)
{
$qUTdd = "SELECT uname from users where `uid = '".$val."'";
$q11 = mysqli_query($dbc,$qUTdd);
$rrr = mysqli_fetch_object($q11);
$arrurtype[] = $rrr->uname;
}
$row = array(
'cola1' =>$row->a1,
'cola2'=>$row->a2,
'cola3'=>$row->a3,
'cola4'=>$row->a4,
'cola5'=>$arrurtype
);
array_push($items, $row);
//$i++;
}