title: PHP: change output of SQL Table before printout
body: <p>i have a beginner Problem. I have following code to access a SQL Table but before i print it out (what works) i want to check if "Zustand" in the table is 0 or 1 and the function should change just the print out to f.e. 1 = good 0 = bad. Is this even possible or do i have to change my SQL Table?</p>
  
  <pre><code>$conn = new mysqli($servername, $username, $password, $dbname);
    // Check connection
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  $sql = "SELECT Nr, Name, Zustand FROM Verbraucher";
  $result = $conn-&gt;query($sql);
  
  if ($result-&gt;num_rows &gt; 0) {
      echo "&lt;table&gt;&lt;tr&gt;&lt;th&gt;Nr&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Zustand&lt;/th&gt;&lt;/tr&gt;";
      // output data of each row
      while($row = $result-&gt;fetch_assoc()) {
  
          echo "&lt;tr&gt;&lt;td&gt;" . $row["Nr"]. "&lt;/td&gt;&lt;td&gt;" . $row["Name"]. "&lt;/td&gt;&lt;td&gt;" . $row["Zustand"]. "&lt;/td&gt;&lt;/tr&gt;";
      }
      echo "&lt;/table&gt;";
  } else {
      echo "0 results";
  }
  
  $conn-&gt;close();
  ?&gt;
  </code></pre>