RE: [PHP] Multiple "if()" statements

2006-06-30 Thread tedd
At 4:26 PM +0100 6/30/06, Ford, Mike wrote: >On 30 June 2006 13:37, tedd wrote: > >> At 11:07 PM -0600 6/29/06, John Meyer wrote: >> > Larry Garfield wrote: >> > > >> > >[1] switch is fine if your elseif comparisons are equality > > based. If they're not equality based, then they don't map to >> s

Re: [PHP] Multiple "if()" statements

2006-06-30 Thread Richard Lynch
On Thu, June 29, 2006 11:07 pm, Larry Garfield wrote: > switch is fine if your elseif comparisons are equality based. If > they're not > equality based, then they don't map to switch as well. Except in PHP which supports: switch(TRUE) { case _boolean_expression_: break; } So you can have ca

RE: [PHP] Multiple "if()" statements

2006-06-30 Thread Ford, Mike
On 30 June 2006 13:37, tedd wrote: > At 11:07 PM -0600 6/29/06, John Meyer wrote: > > Larry Garfield wrote: > > > > > > switch is fine if your elseif comparisons are equality > based. If they're not equality based, then they don't map to > switch as well. > > > > In other words, if you look at

Re: [PHP] Multiple "if()" statements

2006-06-30 Thread John Wells
On 6/30/06, tedd <[EMAIL PROTECTED]> wrote: At 11:07 PM -0600 6/29/06, John Meyer wrote: >Larry Garfield wrote: >> >>switch is fine if your elseif comparisons are equality based. If they're not equality based, then they don't map to switch as well. > Not true. I've come to really appreciate

Re: [PHP] Multiple "if()" statements

2006-06-30 Thread tedd
At 11:07 PM -0600 6/29/06, John Meyer wrote: >Larry Garfield wrote: >> >>switch is fine if your elseif comparisons are equality based. If they're not >>equality based, then they don't map to switch as well. > >In other words, if you look at a logical ladder as the roots of the tree, as >long as

Re: [PHP] Multiple "if()" statements

2006-06-29 Thread John Meyer
Larry Garfield wrote: switch is fine if your elseif comparisons are equality based. If they're not equality based, then they don't map to switch as well. In other words, if you look at a logical ladder as the roots of the tree, as long as each root has the same number of forks (say each for

Re: [PHP] Multiple "if()" statements

2006-06-29 Thread Larry Garfield
On Thursday 29 June 2006 06:51, tedd wrote: > At 8:15 PM -0400 6/28/06, Robert Cummings wrote: > >On Wed, 2006-06-28 at 20:02, David Tulloh wrote: > >> Grae Wolfe - PHP wrote: > >> > ... > >> > > > > > want. Any help would be great! > > -snip- if/elseif -snip- > > > > > Whenever you need a elseif

Re: [PHP] Multiple "if()" statements

2006-06-29 Thread tedd
At 8:15 PM -0400 6/28/06, Robert Cummings wrote: >On Wed, 2006-06-28 at 20:02, David Tulloh wrote: >> Grae Wolfe - PHP wrote: >> > ... > > > want. Any help would be great! -snip- if/elseif -snip- Whenever you need a elseif, then it's time to consider a switch -- like thus: print( "" ); swi

RE: [PHP] Multiple "if()" statements

2006-06-29 Thread Ford, Mike
On 29 June 2006 01:03, David Tulloh wrote: > I'm also going to throw in an elseif for fun, to get this (hopefully) > improved version: > > if($row[1] == "none") { >print(""); >print("$row[0] $row[2]"); >print(""); > } elseif($row[1] == $row[2]) { >print(""); >print("$row[0]

Re: [PHP] Multiple "if()" statements

2006-06-28 Thread Paul Novitski
At 04:38 PM 6/28/2006, Grae Wolfe - PHP wrote: The first problem is men's names and unmarried women's names... they will have the same "hs_last_name" and "last_name" so I don't want the duplicate displaying on the page. The second problem is the entry of the word "none" by some of the visito

Re: [PHP] Multiple "if()" statements

2006-06-28 Thread Robert Cummings
On Wed, 2006-06-28 at 20:02, David Tulloh wrote: > Grae Wolfe - PHP wrote: > > ... > > want. Any help would be great! > > > > > > if($row[1]="none") { > > print(""); > > print("$row[0] $row[2]"); > > print(""); > > } else > > if($row[1]=$row[2]) { > > print(""); > > print("$row[0

Re: [PHP] Multiple "if()" statements

2006-06-28 Thread David Tulloh
Grae Wolfe - PHP wrote: > ... > want. Any help would be great! > > > if($row[1]="none") { > print(""); > print("$row[0] $row[2]"); > print(""); > } else > if($row[1]=$row[2]) { > print(""); > print("$row[0] $row[2]"); > print(""); > } else > print(""); > print("$row[0]