下面代码PHP生成表格实例,经过本站编程之家测试正常运行后贴出来的。
- $link=mysql_connect("localhost","root","123456");
- $db=mysql_select_db("bustest",$link);
- $sql1="select name from info group by name order by id asc";
- print("
");
");- $res1=mysql_query($sql1);
- while($row1=mysql_fetch_array($res1)){
- $name=$row1["name"];
- $sql2="select id from info where name =$name order by id asc";
- $res2=mysql_query($sql2);
- while($row2=mysql_fetch_array($res2)){
- print("
"); ");- $id=$row2["id"];
- print("
$id ");- $sql3="select count(*),id from info where name =$name group by name order by id asc";
- $res3=mysql_query($sql3);
- while($row3=mysql_fetch_array($res3)){
- $id1=$row3["id"];
- if($id1==$id){
- $num=$row3[0];
- print("
"); ");- print $name;
- print("
- }else{
- print("
- }
- }
- }
- print("");
- }
- print("
- mysql_close($link);
- ?>
성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사
R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
1 몇 달 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
1 몇 달 전By尊渡假赌尊渡假赌尊渡假赌
어 ass 신 크리드 그림자 : 조개 수수께끼 솔루션
3 몇 주 전ByDDD
Windows 11 KB5054979의 새로운 기능 및 업데이트 문제를 해결하는 방법
2 몇 주 전ByDDD
Will R.E.P.O. 크로스 플레이가 있습니까?
1 몇 달 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

PhpStorm 맥 버전
최신(2018.2.1) 전문 PHP 통합 개발 도구

Eclipse용 SAP NetWeaver 서버 어댑터
Eclipse를 SAP NetWeaver 애플리케이션 서버와 통합합니다.

SublimeText3 영어 버전
권장 사항: Win 버전, 코드 프롬프트 지원!

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

Dreamweaver Mac版
시각적 웹 개발 도구
