# IF/ELSE Statement w/ Operators Problem

**URL:** <https://forum.kirupa.com/t/if-else-statement-w-operators-problem/311934>\
**Category:** programming\
**Created:** [July 20, 2010, 7:16pm UTC](https://forum.kirupa.com/t/if-else-statement-w-operators-problem/311934 "2010-07-20T19:16:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drummer392](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@drummer392](https://forum.kirupa.com/u/drummer392)\
**Post date:** [July 20, 2010, 7:16pm UTC](https://forum.kirupa.com/t/if-else-statement-w-operators-problem/311934/1 "2010-07-20T19:16:21Z")

</div>

Hey guys,

I have an if/else statement that isn’t working. The statement is this:

```php
if ($score1 == 0) {
		$wins = $old_Score1;
} else if ($score1 > $rows['score1'] && $rows['score1'] > 0) {
		$wins = $old_Score1;
} else if ($score1 < $rows['score1'] && $rows['score1'] > 0) {
		$wins = $old_Score1;
} else if ($score1 > 0 && $rows['score1'] == 0) {;
		$wins = $old_Score1 + 1;
} else if ($score1 == 0 && $rows['score1'] > 0) {
		$wins = $old_Score1 - 1;
}

```

The form is working correctly and all the variables are coming through, I just think the problem is something with the operators in this part:

```php
} else if ($score1 > $rows['score1'] && $rows['score1'] > 0) {

```

Can someone tell me what I am doing wrong?
