View Full Version : Logical problem..

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>";

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


and here is the problem in action:


thanks :)

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...

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

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

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.