日期:2014-05-17 浏览次数:20700 次
// 查询变量
$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']. '<br />';
$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 '<br />';
}
$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]' an