mysql_fetch_assoc為什么只顯示一組數(shù)據(jù)
<?php ????$link?=?mysql_connect('127.0.0.1','root','root')?or?die('數(shù)據(jù)庫鏈接失敗'); ????mysql_select_db('test'); ????mysql_query('set?name?"utf8"'); ????$result?=?mysql_query('select?*?from?users'); ????print_r($result); ????echo?'<br>'; ????$row?=?mysql_fetch_assoc($result); ????print_r($row); ?>
輸出:
Resource id #3
Array ? ?
( ? ?
[id] => 1 ? ?
[username] => tom ? ?
[pid] => 3 ? ?
) ? ?
2017-03-28
所以是mysql_fetch_assoc()方法只顯示數(shù)組的第一個數(shù)據(jù)嘍,
那mysql_fetch_array()呢,也是嗎?
2017-03-27
他只顯示一個指針?biāo)傅牡臄?shù)據(jù)