GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-May-2006, 22:27
epan2001 epan2001 is offline
New Member
 
Join Date: May 2006
Posts: 4
epan2001 is on a distinguished road
Smile

If...else


If(cond1) then
stat1
stat4
elseif(cond2) then
stat2
stat4
elseif(cond3) then
stat3
stat4
endif


Query:

if cond1 satisfies,stat1 and stat4 has to execute,if cond2 satisfies,stat2 and stat4 has to execute......... i dont want to write stat4 in each and every condition.if i write stat4 out of if...else stat(i.e after endif),even any of these conditions wont satisfy,stat4 executes.... stat4 has to be execute only wen any one of the conditions satisfy....so wats the solution...
  #2  
Old 28-May-2006, 23:21
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: If...else


Code:
set flag=false If(cond1) then stat1 set flag=true elseif(cond2) then stat2 set flag=true elseif(cond3) then stat3 set flag=true endif if flag == true then stat4 endif
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:20.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.