note 52095 added to function.mysql-data-seek
| From: | arturo_b at hotmail dot com | Date: | Thu, 21 Apr 2005 03:53:47 +0000 |
| Subject: | note 52095 added to function.mysql-data-seek | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88306@lists.php.net to get a copy of this message | ||
hello, this script would be easy to understand for those that are novice in php whose want to
understand about this function:
the table "user" have 2 columns "id" and "name".
"user" content:
position 0: "id"=195342481 "name"='Arthur'
position 1: "id"=179154675 "name"='John'
>>position 2<<: "id"=157761949 "name"='April'
>>>>third row<<
position 3: "id"=124492684 "name"='Tammy'
position 4: "id"=191346457 "name"='Mike'
<?php
mysql_connect("localhost", "root")
mysql_select_db("test");
$sql = mysql_query("select * from user");
mysql_data_seek($sql, 2);
echo "<table border=1>";
while ($row = mysql_fetch_row($sql)){
echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
}
echo "</tabla>";
?>
explanation:
mysql_data_seek move internal result pointer to the third row of table user. Thus mysql_fetch_row
will begin by april´s row.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-data-seek.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52095
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52095&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52095&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52095&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52095&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52095&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52095&report=yes
Search -- http://master.php.net/manage/user-notes.php