遍历数据表,把相应的数据放到数组中即可例如:<
?php//定义一个数组,用于保存读取到的数据$contents = array();$query = mysql_query("select * from table")
;//遍历数据表while($array = mysql_fetch_array($query)){$contents[] = $array;
}print_r($contents)
;//然后循环数组,或者通过键名使用数组foreach($contents as $value){print_r($value);}echo $contents[0]['字段名称'];?>
顶一下

(0)
0%
踩一下

(0)
0%
- 相关评论
- 我要评论
-