note 82797 added to function.mysql-field-seek
| From: | chris at igwsolutions dot com | Date: | Fri, 25 Apr 2008 22:23:00 +0000 |
| Subject: | note 82797 added to function.mysql-field-seek | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138786@lists.php.net to get a copy of this message | ||
I spent a good deal of time trying to get the example to work, but the example does not work.
To do what the exaple is trying to do, you would need to use mysql_data_seek
assume we have table named testing which contains
id name
1 Hassan
2 Jack
3 Rose
---------------
Here is an expample that will do the above example.
Since I am more comfortable in a OOP setting, I used mysql_fetch_object
<?php
require("myConnenctionFile.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>";
?>
----
Server IP: 208.69.120.35
Probable Submitter: 168.156.145.224
----
Manual Page -- http://www.php.net/manual/en/function.mysql-field-seek.php
Edit -- https://master.php.net/note/edit/82797
Del: integrated -- https://master.php.net/note/delete/82797/integrated
Del: useless -- https://master.php.net/note/delete/82797/useless
Del: bad code -- https://master.php.net/note/delete/82797/bad+code
Del: spam -- https://master.php.net/note/delete/82797/spam
Del: non-english -- https://master.php.net/note/delete/82797/non-english
Del: in docs -- https://master.php.net/note/delete/82797/in+docs
Del: other reasons-- https://master.php.net/note/delete/82797
Reject -- https://master.php.net/note/reject/82797
Search -- https://master.php.net/manage/user-notes.php