Topic awaiting preservation: accessing local variable..pls help (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Australia |
posted 10-21-2003 07:45
I have the following code, can you please help me to figure out how I could access the f_seat_status variable outside the if loop? Thank you. |
Maniac (V) Mad Scientist From: :morF |
posted 10-21-2003 08:35
Hmm...in PHP you would have to give the variable a global scope for it to be available higher up in the heirarchy. That's what you need ot do here, I think, but i don't know the exact function for it |
Bipolar (III) Inmate From: New Jersey, USA |
posted 10-21-2003 08:45
Change where you declare it. I moved it outside the conditional statement right under the declaration of the integer. This will change the scope and allow you to see it. |
Maniac (V) Mad Scientist From: :morF |
posted 10-21-2003 08:48
well, yes...I suppose that one would work too |
Bipolar (III) Inmate From: Australia |
posted 10-23-2003 02:55
Thank you so much for teaching me. Thanks again. |