...

View Full Version : Logical problem..



hs^
01-08-2006, 07:43 PM
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:


http://img267.imageshack.us/img267/3400/untitled5pe.png



thanks :)

Element
01-08-2006, 07:53 PM
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


if (($product->bestelnummer)==$var) {

should be


if ($var=$product->bestelnummer) {

if you mean to set it...

and in any case


if ($product->bestelnummer==$var) {

thats all you need, no need for extra perenthasis...

hs^
01-08-2006, 07:57 PM
ok.. But that wont help the problem.

Element
01-08-2006, 08:46 PM
Okay, sorry. This should do it, if your doing it where I think you are.



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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum