Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    hs^
    hs^ is offline
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Logical problem..

    Hello all.. i got a 'logical' problem, but im still a newbie, maybe someone can help please



    this is the result problem..

    the <fieldset> is not close, along some other tags...

    I loop through a mysql query , and need to categorize it on 'bestelnummer'

    so i did if (($product->bestelnummer)==$var) {
    echo "<tr><td>bla</td></tr>";
    }

    else{
    echo "<fieldset><table>";
    $var = $product->bestelnummer;
    }

    it starts with this else... then sets $var to bestelnummer and loops if, but how would i close the fieldset??? i cant put it out the loop... that would be useless, in the else and it would immideate exit the fieldset also...

    here is the code

    http://www.rafb.net/paste/results/3skmkV56.html

    and here is the problem in action:






    thanks

  • #2
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    You should provide us with more description, what do you want it to do exactly, cause from I see, it works.

    Well for one, it never seems to set $var

    PHP Code:
    if (($product->bestelnummer)==$var) { 
    should be

    PHP Code:
    if ($var=$product->bestelnummer) { 
    if you mean to set it...

    and in any case

    PHP Code:
    if ($product->bestelnummer==$var) { 
    thats all you need, no need for extra perenthasis...
    Last edited by Element; 01-08-2006 at 08:56 PM.

  • #3
    hs^
    hs^ is offline
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok.. But that wont help the problem.

  • #4
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Okay, sorry. This should do it, if your doing it where I think you are.

    PHP Code:
    if($var==$product->bestelnummer))
      echo 
    "</table><hr><br></fieldset>";

    Then that go inside the if statement under all the code.

    See, the problem I'm having is your using mysql_fetch_object() which is hard to work with like this.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •