有一个数据表student 字段分别是 id name age
字段下值有 1 张三 18
2 李四 17
3 王五 18
4 李四 17
我想实现在php里循环输出 table
但是李四的name只输出一次
名字 | 年龄 |
名字 | 年龄 |
$sql=mysql_query('select distinct name , age from student');
select distinct name from student
改为
select distinct name,age from student
$sql=mysql_query('select distinct name , age from student');
select distinct name from student
改为
select distinct name,age from student
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号