Re: Multiple "if()" statements
| From: | Grae Wolfe - PHP | Date: | Thu, 29 Jun 2006 02:26:42 +0000 |
| Subject: | Re: Multiple "if()" statements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238884@lists.php.net to get a copy of this message | ||
Thank you all SO incredibly much!!! Now I just have to figure out how to
get it to put the results into two columns instead of one, and this phase of
this nightmarish project is over!!
I am eternally grateful, and I am sure I will be back with more questions!!
""Grae Wolfe - PHP"" <php@graewolfe.com> wrote in message
news:66.EE.15023.4E213A44@pb1.pair.com...
>I have a table with lots of fun information in it. For one of the pages
>that I am working on, I want to display a list of names based on what is in
>the DB.
> My $SQL statement works great and has pulled in values for "first_name,"
> "hs_last_name," and "last_name" in that order. Right now, I am just
> printing to the screen the results of "first_name (hs_last_name)
> last_name" but there are two problems with this...
> 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
> visitors in place of a "hs_last_name"... obviously I don't want to
> display this either.
> The following is the string of "IF()" statements that I am using, but I
> have an issue with my syntax somewhere because it isn't working the way I
> want. Any help would be great!
>
>
> if($row[1]="none") {
> print("<tr>");
> print("<td>$row[0] $row[2]</td>");
> print("</tr>");
> } else
> if($row[1]=$row[2]) {
> print("<tr>");
> print("<td>$row[0] $row[2]</td>");
> print("</tr>");
> } else
> print("<tr>");
> print("<td>$row[0] ($row[1]) $row[2]</td>");
> print("</tr>");