-1

I want to check in my If-Statement if the status is 1(true) or 0(false). The value is stored in a mySQL DB with tinyint.

The following code returns an error:

if($zeile['STATUS']=='1')
  {
      echo "<td align='center'>true;</td>";
  }
  else{
      echo "<td align='center'>false;</td>"; 
  }

The error is:

Notice: Undefined index: STATUS in /home/u123210707/public_html/index.php on line 49'. line 49

is my If-statement

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

2 Answers2

1
if($zeile['STATUS'] > 0)
  {
/* whatever */
}
Jeremy Board
  • 181
  • 1
  • 9
0

In your $zeile array there is no element like STATUS, that's why its give this error,

i think before if condition you must have to check array using print_r and check there is an element called STATUS.

Nimish Mer
  • 42
  • 2