note 73547 added to control-structures.while
| From: | johanoosterhuis407 at hotmail dot com | Date: | Wed, 28 Feb 2007 20:50:43 +0000 |
| Subject: | note 73547 added to control-structures.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123964@lists.php.net to get a copy of this message | ||
The functie while() has some kind of a bug in it.
If I am using the function while() and also try to connect an mysql loop than he only will display
one loop.
$dbres = mysql_query("SELECT * FROM
partners WHERE
login='{$data->login}'");
while($partner = mysql_fetch_object($dbres)){
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(online) AS online,0
FROM gebruiker WHERE login='{$partner->vriend}'");
$user = mysql_fetch_object($dbres);
if($user->online + 300 > time()){
$status1 = "online";
} else {
$status1 = "offline";
}
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(online) AS online,0
FROM gebruiker WHERE login='{$partner->vriend}'");
$user = mysql_fetch_object($dbres);
if($user->wachttijd_heist + 21600 > time()){
$status2 = "no";
} else {
$status2 = "yes";
}
echo $status1;
echo $status2;
}
anyone got an other option to use the same function: while() -> mysql loop??
----
Server IP: 83.137.20.120
Probable Submitter: 81.206.73.254
----
Manual Page -- http://www.php.net/manual/en/control-structures.while.php
Edit -- https://master.php.net/note/edit/73547
Del: integrated -- https://master.php.net/note/delete/73547/integrated
Del: useless -- https://master.php.net/note/delete/73547/useless
Del: bad code -- https://master.php.net/note/delete/73547/bad+code
Del: spam -- https://master.php.net/note/delete/73547/spam
Del: non-english -- https://master.php.net/note/delete/73547/non-english
Del: in docs -- https://master.php.net/note/delete/73547/in+docs
Del: other reasons-- https://master.php.net/note/delete/73547
Reject -- https://master.php.net/note/reject/73547
Search -- https://master.php.net/manage/user-notes.php