PHP產生表格執行個體代碼_PHP教程

來源:互聯網
上載者:User
下面代碼PHP產生表格執行個體,經過本站編程之家測試正常運行後貼出來的。

  1. $link=mysql_connect("localhost","root","123456");
  2. $db=mysql_select_db("bustest",$link);
  3. $sql1="select name from info group by name order by id asc";
  4. print("
  5. $res1=mysql_query($sql1);
  6. while($row1=mysql_fetch_array($res1)){
  7. $name=$row1["name"];
  8. $sql2="select id from info where name =$name order by id asc";
  9. $res2=mysql_query($sql2);
  10. while($row2=mysql_fetch_array($res2)){
  11. print("
  12. $id=$row2["id"];
  13. print("
  14. $sql3="select count(*),id from info where name =$name group by name order by id asc";
  15. $res3=mysql_query($sql3);
  16. while($row3=mysql_fetch_array($res3)){
  17. $id1=$row3["id"];
  18. if($id1==$id){
  19. $num=$row3[0];
  20. print("
  21. }else{
  22. print("
  23. }
  24. }
  25. }
  26. print("");
  27. }
  28. print("
  29. "); "); "); "); ");
    $id");
  30. print $name;
  31. print("
  32. ");
  33. mysql_close($link);
  34. ?>

http://www.bkjia.com/PHPjc/486157.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486157.htmlTechArticle下面代碼PHP產生表格執行個體,經過本站編程之家測試正常運行後貼出來的。 ?php $link=mysql_connect("localhost","root","123456"); $db=mysql_select_db("bustest"...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.