note 84023 added to control-structures.while
| From: | s dot seitz at netz-haut dot de | Date: | Tue, 24 Jun 2008 15:21:42 +0000 |
| Subject: | note 84023 added to control-structures.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140768@lists.php.net to get a copy of this message | ||
Due to the fact that php only interprets the necessary elements to get a result, I found it
convenient to concatenate different sql queries into one statement:
<?php
$q1 = 'some query on a set of tables';
$q2 = 'similar query on a another set of tables';
if ( (($r1=mysql_query($q1)) && ($r2=mysql_query($q2)) ) {
while (($row=mysql_fetch_assoc($r1))||($row=mysql_fetch_assoc($r2))) {
/* do something with $row coming from $r1 and $r2 */
}
}
?>
----
Server IP: 212.124.37.9
Probable Submitter: 212.6.132.162
----
Manual Page -- http://www.php.net/manual/en/control-structures.while.php
Edit -- https://master.php.net/note/edit/84023
Del: integrated -- https://master.php.net/note/delete/84023/integrated
Del: useless -- https://master.php.net/note/delete/84023/useless
Del: bad code -- https://master.php.net/note/delete/84023/bad+code
Del: spam -- https://master.php.net/note/delete/84023/spam
Del: non-english -- https://master.php.net/note/delete/84023/non-english
Del: in docs -- https://master.php.net/note/delete/84023/in+docs
Del: other reasons-- https://master.php.net/note/delete/84023
Reject -- https://master.php.net/note/reject/84023
Search -- https://master.php.net/manage/user-notes.php