时间:2021-07-01 10:21:17 帮助过:4人阅读
// 查询变量
$sql1 = "select remark,name from arp_careset where typegroup ='dissect-position' order by id";
$rs1 = mysql_query($sql1);
while($r1 = mysql_fetch_assoc($rs1))
{ echo $r1['name'];
$sql = "select group_concat(name) as name from arp_careset where typegroup <>'dissect-position' and typegroup like '%".$r1["remark"]."%' order by id";
$rs = mysql_query($sql);
while($r = mysql_fetch_array($rs))
{ $ar = explode(',', $r['name']);
echo join(' ', $ar);
} }
//构建数组
$mem = array(
array
(
lang_show(''),
array
(
// 嵌套开始
array(
lang_show('account_manager'),
//第二层嵌套
array(
'group_list.php,1',
)
//第二层嵌套结束
),
// 嵌套结束
)
),
);
$rs = mysql_query("select name, SUBSTRING_INDEX(typegroup,'-',-1) as secondary, remark from arp_careset where SUBSTRING_INDEX(typegroup,'-',1)='dissect'");
while($r = mysql_fetch_assoc($rs)) {
echo $r['name']. '
';
$rs1 = mysql_query("select name, SUBSTRING_INDEX(typegroup,'-',-1) as secondary, remark from arp_careset where SUBSTRING_INDEX(typegroup,'-',1)='$r[secondary]' and SUBSTRING_INDEX(typegroup,'-',-1) = '$r[remark]'");
while($r = mysql_fetch_assoc($rs1)) {
echo $r['name'] . ' ';
}
echo '
';
}
$res = array(); //这是结果数组
$rs = mysql_query("select name, SUBSTRING_INDEX(typegroup,'-',-1) as secondary, remark from arp_careset where SUBSTRING_INDEX(typegroup,'-',1)='dissect'");
while($r = mysql_fetch_assoc($rs)) {
$tmp = array(); //初始化一个临时数组
$rs1 = mysql_query("select name, SUBSTRING_INDEX(typegroup,'-',-1) as secondary, remark from arp_careset where SUBSTRING_INDEX(typegroup,'-',1)='$r[secondary]' and SUBSTRING_INDEX(typegroup,'-',-1) = '$r[remark]'");