Re: Shopping cart application question
| From: | Ron Piggott | Date: | Sun, 04 Apr 2010 04:44:46 +0000 |
| Subject: | Re: Shopping cart application question | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47015@lists.php.net to get a copy of this message | ||
I have done something like you have said below Chris.
I put the code which is common to be loops in it's own file and I did an
INCLUDE
Ron
-----Original Message-----
From: chris smith <dmagick@gmail.com>
To: ron.piggott@actsministries.org
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Shopping cart application question
Date: Sun, 4 Apr 2010 13:36:05 +1000
> The " } else { " confuses PHP. I am not sure what I should be doing.
You're missing at least one brace.
If the code you supplied is a copy of what you have, you're missing a
} for the end of the while loop and one for the end of the else
condition.
So it's treating } else { as part of the while construct (and while()
doesn't have anything like an else condition).
> if ( $_SESSION['user_reference'] > 0 ) {
<snip>
> $i=0;
> while ( $i < $cart_records_found ) {
>
} // end while
> } else {
>
> foreach ($_SESSION['order'] AS $key => $value ) {
>
> }
>
} // end else condition