row1 = tb.insertRow();
with(tb.rows(tb.rows.length-1)){
Select sum as  from,where就是要陈列数组.一个表.然后表现出来...要写一些条件哦..按条件列出来..要求和的.

解决方案 »

  1.   

    要陈列数组用 print_r() 不就行了吗?
      

  2.   

    tb.insertRow()这是JavaScript的方法,还是PHP的呢?
      

  3.   

    表 如下
    表名为 ka_tan
    id----riqi----cla1---cla2---cla3---sum_m
       10-1    a      y              13
          10-1    b                     10 
       10-1    c      y              12
          10-1    d                     10 
       10-1    a      y              16
          10-1    b                     10 
       10-1    a      y              11
          10-1    b                     10 
       10-2    a      y              13
          10-2    b                     10 
       10-2    c      y              12
          10-2    d                     10 
       10-2    a      y              16
          10-2    b                     10 
       10-2    a      y              11
          10-2    b                     10 
    现在写写了几条语写出来了.但是不会合成..现在都是按一个列显出来.
    都是竖的.. 应该也有横的才对呀. 
    还有如果再增加一个条件选择框.就是按riqi 来选择.比如选择日期 10-1的时候.
    就只显示相关的出来.<table   width="99%" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="f1f1f1" id="tb">
      <tr > 
        <td  align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">id</td>
        <td  align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">a</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">heji</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">总</td>
        <td  align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">b</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">heji</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">总</td>
        <td  align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">c</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">heji</td>
        <td  align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">d</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">heji</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">总</td>
        <td  align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">e</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">heji</td>
        <td align="center" nowrap bordercolor="cccccc" bgcolor="#FDF4CA">总</td>
      </tr><?php
    $exec="select cla3,count(cla3) as heji,sum(sum_m) as summoney  from ka_tan where cla1='a'  or cla2='y' and cla3 in (select cla3 from ka_tan where cla1='a' or cla2='y') group by cla3 order by summoney desc;";
    $result=mysql_query($exec); 
    while ($rs=mysql_fetch_array($result)){
    ?>
      <tr>
      <td align="center" nowrap>id</td>
    <td align="center" nowrap><?php echo $rs['cla3'];?></td>
        <td align="center" nowrap><?php echo $rs['heji'];?></td>
        <td align="center" nowrap><?php echo $rs['summoney'];?></td> </tr> 
    <?php
    }
    ?>
     <?php
    $exec="select cla3,count(cla3) as heji,sum(sum_m) as summoney  from ka_tan where cla1='c' and cla3 in (select cla3 from ka_tan where cla1='c') group by cla3 order by summoney desc;;";
    $result=mysql_query($exec); 
    while ($rs=mysql_fetch_array($result)){
    ?>
     <tr>  
        <td align="center" nowrap>id</td>
        <td align="center" nowrap><?php echo $rs['cla3'];?></td>
        <td align="center" nowrap><?php echo $rs['heji'];?></td>
        <td align="center" nowrap><?php echo $rs['summoney'];?></td> </tr>  
        <?php
    }
    ?>
     
     <?php
    $exec="select cla3,count(cla3) as heji,sum(sum_m) as summoney  from ka_tan where cla1='b' and cla3 in (select cla3 from ka_tan where cla1='b') group by cla3 order by summoney desc;;";
    $result=mysql_query($exec); 
    while ($rs=mysql_fetch_array($result)){
    ?>
     <tr>  
         <td align="center" nowrap>id</td>
        <td align="center" nowrap><?php echo $rs['cla3'];?></td>
        <td align="center" nowrap><?php echo $rs['heji'];?></td>
        <td align="center" nowrap><?php echo $rs['summoney'];?></td> </tr>  
        <?php
    }
    ?> 
     <?php
    $exec="select cla3,count(cla3) as heji,sum(sum_m) as summoney  from ka_tan where cla1='d' and cla3 in (select cla3 from ka_tan where cla1='d') group by cla3 order by summoney desc;;";
    $result=mysql_query($exec); 
    while ($rs=mysql_fetch_array($result)){
    ?>
     <tr>  
         <td align="center" nowrap>id</td>
        <td align="center" nowrap><?php echo $rs['cla3'];?></td>
        <td align="center" nowrap><?php echo $rs['heji'];?></td>
        <td align="center" nowrap><?php echo $rs['summoney'];?></td> </tr>  
        <?php
    }
    ?></table>
      

  4.   

    id----riqi----cla1---cla2---cla3---sum_m       
    ------10-1------a------y------------13         
    ------10-1------b------ ------------10        
    ------10-1------c------y------------12         
    ------10-1------d------ ------------10        
    ------10-1------a------y------------16         
    ------10-1------b------ ------------10        
    ------10-1------a------y------------11         
    ------10-1------b------ ------------10        
    ------10-2------a------y------------13         
    ------10-2------b------ ------------10        
    ------10-2------c------y------------12         
    ------10-2------d------ ------------10        
    ------10-2------a------y------------16         
    ------10-2------b------ ------------10        
    ------10-2------a------y------------11         
    ------10-2------b------ ------------10