I don't know how much this is worth, but it helped me deal with an
if/else statement that was killing me.
I just coded a very simple if/else statement like so:
<?PHP
$a = 1;
$b = 2;
if($a < $b) {
echo "A is smaller than B";
}
else {
echo "B is smaller than A";
}
?>
And I made SURE that worked. Once it did, I started adding things,
making sure it worked after each change until I got it where I wanted
it. Once it did what I wanted, I copied it into my working script.
Sometimes it works to just start over with something simpler, then work
your way back up.
HTH,
Jason Soza
----- Original Message -----
From: "Jennifer Downey" <[EMAIL PROTECTED]>
Date: Tuesday, April 23, 2002 10:26 am
Subject: Re: [PHP] If else question
> Ok I have hard coded $quantity so it does = 0 and else still prints.
> "Maxim Maletsky )" <[EMAIL PROTECTED]> wrote in message
> 004701c1eaf1$c915c6b0$92e3021a@machine52">news:004701c1eaf1$c915c6b0$92e3021a@machine52...
> >
> > Try this, Jennifer:
> >
> > Without messing the rest of your code, change the line:
> >
> > $quantity = $row['quantity'];
> >
> > With this one:
> >
> > $quantity = 0;
> >
> > In other words: hardcode it for testing.
> >
> > If "else" always prints, then you are missing something in your
> query.> Otherwise you've got something wrong in your code.
> >
> >
> >
> >
> >
> > Sincerely,
> >
> > Maxim Maletsky
> > Founder, Chief Developer
> >
> > www.PHPBeginner.com // where PHP Begins
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php