note 68212 added to function.mysql-result
| From: | gack at bar dot foo | Date: | Tue, 18 Jul 2006 14:42:24 +0000 |
| Subject: | note 68212 added to function.mysql-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114888@lists.php.net to get a copy of this message | ||
if you want to do something based on the fact that the data is the same in the next row, then
looking ahead is easy with this.
<?php
$i=0;
$rows=mysql_num_rows($result);
while($i < $rows) {
$x = mysql_result($result, $i, 0);
if ($x = mysql_result($result, $i+1, 0)) {
echo "It's the same thing!";
}
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 207.206.231.225
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mysql-result.php
Edit -- http://master.php.net/note/edit/68212
Del: integrated -- http://master.php.net/note/delete/68212/integrated
Del: useless -- http://master.php.net/note/delete/68212/useless
Del: bad code -- http://master.php.net/note/delete/68212/bad+code
Del: spam -- http://master.php.net/note/delete/68212/spam
Del: non-english -- http://master.php.net/note/delete/68212/non-english
Del: in docs -- http://master.php.net/note/delete/68212/in+docs
Del: other reasons-- http://master.php.net/note/delete/68212
Reject -- http://master.php.net/note/reject/68212
Search -- http://master.php.net/manage/user-notes.php