Re: [PHP] If else question

2002-04-23 Thread Miguel Cruz
On Tue, 23 Apr 2002, Jennifer Downey wrote: I am wondering. When you use an if else statement and a condition exists isn't the if part suppose to stop? Then if the condition doesn't exist it is suppose to do something else? I am wondering because I have a form that goes something like this.

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing you didn't do that, and you're seeing the execution of all but the first of the statements following the else. So it should be: if ($var1)

RE: [PHP] If else question

2002-04-23 Thread Leotta, Natalie (NCI/IMS)
Does it show the message and the form or just the message? -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question If and else expect to be followed by exactly 1 statement. To aggregate multiple statements as one, surround them with {curly braces}. I'm guessing yo

RE: [PHP] If else question

2002-04-23 Thread Leotta, Natalie (NCI/IMS)
you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natalie Leotta [EMAIL PROTECTED] wrote

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
xpertise, but it's something you could look into if no one else has any better ideas :-) -Natalie -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 12:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question It shows both. Natali

Re: [PHP] If else question

2002-04-23 Thread -BD-
Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting service thinkg it may have been because

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
01c1eae9$d58f4360$[EMAIL PROTECTED]... Is this a nested if? (inside another if statement?) - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:05 PM Subject: Re: [PHP] If else question I just looked at my hosting servic

RE: [PHP] If else question

2002-04-23 Thread Maxim Maletsky \(PHPBeginner.com\)
your mind... - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:17 PM Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about

RE: [PHP] If else question

2002-04-23 Thread Maxim Maletsky \(PHPBeginner.com\)
]] Sent: Tuesday, April 23, 2002 7:18 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd

RE: [PHP] If else question

2002-04-23 Thread Fifield, Mike
] Subject: Re: [PHP] If else question No this is the first if statement but there are nested if's after that. I'd post the code but everyone yells at me about my coding style. If you promise not to yell I will post it. Jennifer -Bd- [EMAIL PROTECTED] wrote in message 001d01c1eae9$d58f4360$[EMAIL

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
Ok you asked for it. Don't say I didn't warn you. session_start(); $query = SELECT name FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $user = $row['name']; $query = SELECT uid, id, iname, image, quantity, type FROM

RE: [PHP] If else question

2002-04-23 Thread Maxim Maletsky \(PHPBeginner.com\)
www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question Ok you asked for it. Don't say I didn't warn you. session_start(); $query

RE: [PHP] If else question

2002-04-23 Thread Maxim Maletsky \(PHPBeginner.com\)
To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question Ok you asked for it. Don't say I didn't warn you. session_start(); $query = SELECT name FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($query); while($row = mysql_fetch_array($ret)) { $user = $row['name

RE: [PHP] If else question

2002-04-23 Thread Maxim Maletsky \(PHPBeginner.com\)
you've got something wrong in your code. Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP

Re: [PHP] If else question

2002-04-23 Thread Richard Emery
fetched via mysql_fetch_array() to ensure they contain valid data? - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:48 PM Subject: Re: [PHP] If else question Ok you asked for it. Don't say I didn't warn you. session_start

Re: [PHP] If else question

2002-04-23 Thread -BD-
] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:48 PM Subject: Re: [PHP] If else question Ok you asked for it. Don't say I didn't warn you. session_start(); $query = SELECT name FROM {$config[prefix]}_users WHERE uid={$session[uid]}; $ret = mysql_query($query); while($row

RE: [PHP] If else question

2002-04-23 Thread Maxim Maletsky \(PHPBeginner.com\)
Jennifer, satus! People are nervous here! Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
rd, have you printed out all the values fetched via mysql_fetch_array() to ensure they contain valid data? - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 12:48 PM Subject: Re: [PHP] If else question Ok y

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
eveloper www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question Ok you asked for it. Don't say I didn't warn you. session_start();

Re: [PHP] If else question

2002-04-23 Thread heinisch
Aeh, sorry - but is the 1 you test for actual a number or is it a string? I had made this mistakes earlier, so also try if ( $quantity == 1) Maybe I´m absolutely wrong, (PHP 3 knowledge) but Oliver At 23.04.2002 10:48, you wrote: Ok you asked for it. Don't say I didn't warn you.

Re: [PHP] If else question

2002-04-23 Thread Miguel Cruz
incerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 7:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] If else question Ok y

Re: [PHP] If else question

2002-04-23 Thread Jason Soza
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"

Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey
I have it. I actually got it! I had the if statement in the wrong place. Here is what I did: if($quantity 1) { echo Sorry I can't seem to locate this item; } else { //check if form has been submitted if($submit) { } else { //if the form has not been submitted run the following echo FORM

RE: [PHP] If...Else question

2002-03-14 Thread Vlad Kulchitski
Of course it's legal, absolutely. You have to make sure though that you don't use double quotes in php portion, and if you do, you have to escape them for instance: echo font color=\red\; if you paste the code that's causing the problem, we can take a look. Vlad -Original Message-

Re: [PHP] If...Else question

2002-03-14 Thread Nick Winfield
On Thu, 14 Mar 2002, Brad Harriger wrote: !-- snip -- ? // Now back to the PHP code $d = 250; } else { $e = Does not apply. } ? I have some code similar to this example. When I run the code in my browser, I get a parse error on the last line (?). Replace: $e = Does not