我发现他们两个都在做同样的工作。有没有区别。我想,我错过了一些东西。
mysql_data_seek
<?php
$sql="SELECT * from testing";
$result=mysql_query($sql);
$row = mysql_fetch_object($result);
echo $row->id . ' ' . $row->name; // Output is (1 Hassan)
mysql_data_seek($result,2);
$row = mysql_fetch_object($result);
echo $row->id . ' ' . $row->name; // Output is (3 Rose)
echo "<BR><BR>";
?>
mysql_field_seek
<?php
mysql_connect("sql.server.com", "username", "password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
$sql="SELECT * from table1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
echo $row['ID'] . ' ' . $row['Name']; // Output is (1 Hassan)
mysql_field_seek($result,2);
echo $row['ID'] . ' ' . $row['Name']; // Output is (3 Rose)
?>