note 79470 added to control-structures.do.while
| From: | jantschatgmaildotcom at osu1 dot php dot net | Date: | Thu, 29 Nov 2007 01:56:57 +0000 |
| Subject: | note 79470 added to control-structures.do.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132648@lists.php.net to get a copy of this message | ||
Useful when you want to continue to read a recordset that was already being read like in:
<?
$sql = "select * from customers";
$res = mysql_query( $sql );
// read the first record
if( $rs = mysql_fetch_row( $res ) ){
// do something with this record
}
// do another stuff here
// keep reading till the end
if( mysql_num_rows( $res )>1 ){
do{
// processing the records till the end
}while( $rs = mysql_fetch_row( $res ));
}
?>
----
Server IP: 200.185.126.110
Probable Submitter: 189.30.2.43
----
Manual Page -- http://www.php.net/manual/en/control-structures.do.while.php
Edit -- https://master.php.net/note/edit/79470
Del: integrated -- https://master.php.net/note/delete/79470/integrated
Del: useless -- https://master.php.net/note/delete/79470/useless
Del: bad code -- https://master.php.net/note/delete/79470/bad+code
Del: spam -- https://master.php.net/note/delete/79470/spam
Del: non-english -- https://master.php.net/note/delete/79470/non-english
Del: in docs -- https://master.php.net/note/delete/79470/in+docs
Del: other reasons-- https://master.php.net/note/delete/79470
Reject -- https://master.php.net/note/reject/79470
Search -- https://master.php.net/manage/user-notes.php