需求是这样的:页面有两个SELECT框,一个是IP,一个是姓名,要求SELECT语句是根据这两个SELECT框随机显示的,例:如果我只选择IP:select ip from biao group by ip
如果我只选择姓名:select name from biao group by name
如果两个都选:select ip,name from biao group by ip,name所以我就将两个SELECT框定义成数组的形式arg[],
  foreach($arg as $key => $value){
             $groupby[] = $key;
  }
select  ".implode(',', $groupby)." group by ".implode(',', $groupby)."页面显示的时候也要随机显示
$count_num=count($groupby);//统计选择了多少项
while($data = mysql_fetch_array($query)){
                        printf("<tr>");
                for($i=0;$i<$count_num;$i++){
                         
                       $format = "<a href=\"javascript: window.open('View.php?id=$data[$i]&part_name=$groupby[$]','_blank');void(0);\">%s</a>" : "%s";
                        printf("<td nowrap>$format</font></td>",$data[$i]); }关键问题:循环显示的td加上连接,将值传给View.php,如果选择了IP和name,
页面显示
IP               name
192.168.1.1      color无论点IP的超连接还是name的超连接都要将192.168.1.1和color这两个字段及值都传给View.php,而我现在TD是循环的,只能将该选中的连接的字段和值传过去,请问高手有什么办法解决吗?谢谢