作者autumned (autumned)
看板PHP
标题[请益] SQL只能取到一笔资料?
时间Tue Dec 20 20:56:51 2011
$highscore = mysql_query("SELECT Highscore FROM score ORDER BY Highscore desc
LIMIT 5");
print_r ($highscore);
$highscoreResult = mysql_fetch_assoc($highscore);
print_r ($highscoreResult);
如题 我的table里有多笔资料 用phpmyadmin测试执行也可以取出最高分数的五笔资料
但是用php是了好几种写法都只能得到最高的那一个 请问要怎麽取得多笔资料呢@@
Resource id #8
Array ( [Highscore] => 98384 )
这是上面执行的结果
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.231.96.222
1F:推 streitleak:你要不要去看一下php的文件? 基本上没做回圈 12/20 21:07
2F:→ streitleak:基本上都是取到第一笔资料 12/20 21:08
3F:→ streitleak:php.net/manual/en/function.mysql-fetch-assoc.php 12/20 21:08
4F:→ streitleak:看一下他的范例吧 12/20 21:09
5F:→ autumned:好,我知道了,谢谢: ) 12/20 21:16