1 mysql_fetch_row mysql_fetch_array
1.1 mysql_fetch_row
<?php
while($row = mysql_fetch_row($result)){
$n=0;
?>
<b><span style="">
<?php
if($n==0){
echo $row [14];
?>
1.2 mysql_fetch_array
注释:mysql_fetch_array() 是 mysql_fetch_row() 的扩展版本。除了将数据以数字索引方式储存在数组中之外,还可以将数据作为关联索引储存,用字段名作为键名
例子
<?php $con = mysql_connect("localhost", "hello", "321"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person WHERE Lastname='Adams'"; $result = mysql_query($sql,$con); print_r(mysql_fetch_array($result)); mysql_close($con); ?>