PHP通过数据库的数据,输出要达到一下效果该如何实现?(要求升序输出)

id  time
1     x1
2     x2
.      .
.      .
.      .id  time     
2     x2
3      x3
.      .
.      .id  time     
3      x3
4     x4
.      .

解决方案 »

  1.   

    考试题?
    mysql_data_seek -- 移动内部结果的指针
      

  2.   

    我通过sql语句得到结果集,按照id的大小升序排列输出,但是我想从id=2开始输出升序输出。
      

  3.   

    select * from table where id>1 order by id ASC; //这样就可以了。
      

  4.   


    1.假如我不知道表中id的最小值(设为min),但是需要输出出去大于id=min 的数据,SQL语句该如何写呢?
    2.如果表中id中,最小值的两个不是连续的(如7,15),要求输出除去最小的两个值以外的数据,该如何操作?
    谢谢!!
      

  5.   

    $sql1=select id from table where order by id ASC;
    $row=mysql_fetch_array($sql);
    $i=0;
    $sql=select * from table where id>$row[0] order by id asc;$sql=select * from table where id>$row[1] order by id asc;
      

  6.   


    select * from table where id> $min至于第二个,可以全部 select  ,然后输出前把前两个 break 就行了
      

  7.   

    对楼上的进行补充楼主可以了解一下array_shift、arrayy_pop、unset 等相关函数