Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,461 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,360 people online right now. Registration is fast and FREE... Join Now!




if else

 
Reply to this topicStart new topic

if else, Is this correct?

Adsa
post 8 May, 2005 - 12:16 AM
Post #1


New D.I.C Head

*
Joined: 21 Apr, 2005
Posts: 27


My Contributions


I need some more help please just wondering if this statement is correct for an if else stament?

CODE
if ($clan_select = $clan_name)  {
        if ($challanger_score > $defender_score) {
       $win = "Win";
}      else    {
       $win = "Loose"; }
}      else {
       if ($challanger_score < $defender_score) {
      $win = "Loose";
}     else  {
      $win = "Win";}
}


Thanks
User is offlineProfile CardPM

Go to the top of the page

Adsa
post 8 May, 2005 - 01:50 AM
Post #2


New D.I.C Head

*
Joined: 21 Apr, 2005
Posts: 27


My Contributions


Umm I have fixed it. Working fine now.

CODE
if ((($clan_select == $clan_name) && ($challanger_score > $defender_score)) xor (($clan_select != $clan_name) && ($challenger_score < $defender_score))) {
      $win = "Win";
}     else  {
      $win = "Loss";
}
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 12:40PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month