fact: "Humans, We Used To Be Exactly Like Them: Flawed, Weak, Organic.. But We Evolved, To Include The Synthetic. Now We Use Both To Obtain Perfection"
BastardDomain Forums \ Development \ while lus in andere while lus
while lus in andere while lus
Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
4 Apr 2004

ik heb een probleempje met een while loop in een andere while loop

het script laat folders zien met bijbehorende links eronder

het werkt wel, maar alleen als ik de query van de binnenste while loop meerdere keren uitvoer binnen de buitenste while loop.

als ik de binnenste query erbuiten haal (en dus maar 1x uitvoer) dan krijg ik alleen de links te zien uit de eerste folder

ik heb al een keer ditzelfde probleem gehad maar de oorzaak was destijds dat ik mijn resultvariabele dezelfde naam had gegeven

+++++++++++++++++zo zou ik het willen, maar dit werkt niet++++++
<? 
$qGroup="SELECT * FROM favouritefolder WHERE account_id='".$_SESSION['account_id']."' ";
if (!$rGroup=mysql_query($qGroup))
$errorfavourites=1;
else{
//Favorieten ophalen
$qURL="SELECT * FROM favourites WHERE account_id='".$_SESSION['account_id']."' ";
if (!$rURL=mysql_query($qURL)){
echo 'ERROR'; $errorfavourites=1;
}else {
$qURL="SELECT * FROM favourites WHERE account_id='".$_SESSION['account_id']."' ";
if (!$rURL=mysql_query($qURL)){
echo 'ERROR'; $errorfavourites=1;
}
while ($aGroup=mysql_fetch_assoc($rGroup)){
//zet groep weg
echo '<tr><td>FOLDER'.$aGroup['folder_name'].' folder_id='.$aGroup['folder_id'].'</td></tr>';

while ($aURL=mysql_fetch_assoc($rURL)){
//zet onderliggende urls weg
if ($aURL['folder_id']==$aGroup['folder_id'])
echo '<tr><td>'.$aURL['URL'].'folder_id='.$aURL['folder_id'].'</td></tr>';
echo '<pre>'; print_R ($aURL); echo '</pre>';
}
}
}
}
?>

++++++++++++++++Zo werkt het, maar dan met meerdere query's +++++


<? 
$qGroup="SELECT * FROM favouritefolder WHERE account_id='".$_SESSION['account_id']."' ";
if (!$rGroup=mysql_query($qGroup))
$errorfavourites=1;
else{
//Favorieten ophalen
$qURL="SELECT * FROM favourites WHERE account_id='".$_SESSION['account_id']."' ";
if (!$rURL=mysql_query($qURL)){
echo 'ERROR'; $errorfavourites=1;
}else {
while ($aGroup=mysql_fetch_assoc($rGroup)){
//zet groep weg
echo '<tr><td>FOLDER'.$aGroup['folder_name'].' folder_id='.$aGroup['folder_id'].'</td></tr>';

$qURL="SELECT * FROM favourites WHERE account_id='".$_SESSION['account_id']."' ";
if (!$rURL=mysql_query($qURL)){
echo 'ERROR'; $errorfavourites=1;
}
while ($aURL=mysql_fetch_assoc($rURL)){
//zet onderliggende urls weg
if ($aURL['folder_id']==$aGroup['folder_id'])
echo '<tr><td>'.$aURL['URL'].'folder_id='.$aURL['folder_id'].'</td></tr>';
echo '<pre>'; print_R ($aURL); echo '</pre>';
}
}
}
}
?>

This post was edited by Gorgeous George at 4 Apr 2004

bLAM
Kroquet Bastard

avatar bLAM

Registered: 27 Aug 2001
Location: anywhere
Posts: 1669
5 Apr 2004

toch is er iets niet helemaal goed smilie
"http($this->addslashes("http://www.angelfire.com/pro/blam/whileinwhile.jpg")) . "\" border=\"0\" alt=\"[user image]\" />"
"Never let your sense of morals prevent you from doing what's right - Isaac Asimov"
Rainman
BMW Bastard

avatar Rainman

Registered: 11 Apr 2001
Location: Everywhere
Posts: 5391
5 Apr 2004

mmm
The only reason that you're conscious right now is because I don't want to carry you. - Jack Bauer
"http($this->addslashes("http://87.233.202.7/stuff/bauer/sig.php")) . "\" border=\"0\" alt=\"[user image]\" />"
Fox
The Guzzler

avatar Fox

Registered: 10 Apr 2001
Location: North-Brabant
Posts: 9401
9 Apr 2004

Probeer van al die queries eens 1 querie te maken.

En een while loop

Refuse to do what you don't want to do.
"http("http://www.bastarddomain.com/dev/ico/quote.php") . "\" target=\"_blank\">"http($this->addslashes("http://www.bastarddomain.com/dev/ico/signature.php?show")) . "\" border=\"0\" alt=\"[user image]\" />""
bLAM
Kroquet Bastard

avatar bLAM

Registered: 27 Aug 2001
Location: anywhere
Posts: 1669
10 Apr 2004

misschien leuk om een eind te maken aan die grote plaatjes:

    Quote
    <!-- resize images by Gert en Hieronymus. http://gathering.tweakers.net/forum/list_messages/826648///Images,resizen,javascript -->
    <style type="text/css">

    img[onload] {
    max-width: 580px;
    }

    img.resized {
    border: 2px dashed red;
    cursor: pointer;
    cursor: hand;
    }
    </style>
    <script type="text/javascript">

    var maxWidth = 580;

    function scaleImage(im) {

    if (typeof im.naturalWidth == 'undefined') im.naturalWidth = im.width;

    if (im.naturalWidth > maxWidth) {

    im.width = maxWidth;
    im.style.maxWidth = im.naturalWidth + 'px';
    im.className = 'resized';
    im.title = 'Klik voor originele grootte';
    im.onclick = unscaleImage;

    }

    }

    function unscaleImage() {

    if (this.width == maxWidth) {

    this.width = this.naturalWidth;
    this.style.borderWidth = '0px';
    this.title = 'Klik om te verkleinen';

    } else {

    this.width = maxWidth;
    this.style.borderWidth = '2px';
    this.title = 'Klik voor originele grootte';

    }

    }

    </script>

gejat van flabber uiteraard smilie
"Never let your sense of morals prevent you from doing what's right - Isaac Asimov"
Fox
The Guzzler

avatar Fox

Registered: 10 Apr 2001
Location: North-Brabant
Posts: 9401
10 Apr 2004

Ik had zelf ook zoiets gemaakt
Maar dan wordt er eenmaal gecontroleerd bij het posten.
Zodat ie er een link van maakt als het plaatje te groot wordt.

Maar misschien is dit wel makkelijker.
Refuse to do what you don't want to do.
"http("http://www.bastarddomain.com/dev/ico/quote.php") . "\" target=\"_blank\">"http($this->addslashes("http://www.bastarddomain.com/dev/ico/signature.php?show")) . "\" border=\"0\" alt=\"[user image]\" />""
Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
20 Apr 2004

"http($this->addslashes("http://theoctobot.tripod.com/images/front/frlefttop.jpg")) . "\" border=\"0\" alt=\"[user image]\" />"

This post was edited by Gorgeous George at 20 Apr 2004

Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
20 Apr 2004

"http($this->addslashes("http://members.fortunecity.com/gorgeous1/116.JPG")) . "\" border=\"0\" alt=\"[user image]\" />"
Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
20 Apr 2004

testing 12
bLAM
Kroquet Bastard

avatar bLAM

Registered: 27 Aug 2001
Location: anywhere
Posts: 1669
21 Apr 2004

wie is de persoon van de wazige schim op de foto?
"Never let your sense of morals prevent you from doing what's right - Isaac Asimov"
Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
21 Apr 2004

iemand van de funweek

kijk op www.sjorsmiltenburg.com en klik op funweek voor de foto's

ik was hier even aan het testen of de site die ik gebruik voor de foto's remote linking ondersteund
McBastard
Trend setting Bastard

avatar McBastard

Registered: 21 Jun 2001
Location: Tilburg
Posts: 189
21 Apr 2004

    Quote originally posted by bLAM @ 2004-04-21 08:39:36
    wie is de persoon van de wazige schim op de foto?


Misschien wel een chick.

None
 1 
© 2000 - 2023 BastardDomain.com