title: PHP to make an SQL query to indicate which rows contain text in specific column?
body: <p>I have a table that is reading from an SQL database full of job numbers and the relevant customers and machine order. I also have a "notes" column in the "operations" table which will sometimes contain text that is entered by others. What I need is to display some sort of indication that text has been entered into the notes column for the specific jobID and operation.</p>
  
  <p>So far, I've tried the empty function but I don't think I'm displaying the results of the query properly so its constantly saying that there's text for all jobs.</p>
  
  <p>Here is the relevant code below:</p>
  
  <pre><code>$conN = mysqli_connect(DB_HOST, DB_USER);
          if (!$conN) {die('Could not connect: ' . mysqli_error($conN));} // Check Connection
  
          mysqli_select_db($conN,"jms");
          $jid = $row['jobID'];
          $opn = $row['operation'];
          $highlight = mysqli_query($conN,"SELECT notes FROM operations WHERE jobID=$jid AND operation=$opn");
  
  
  
          if (empty($highlight)) {
              echo "&lt;td style='background-color:blue;'&gt;"."&lt;/td&gt;";
          }else{
              echo "&lt;td style='background-color:red;'&gt;"."&lt;/td&gt;";
          }
  </code></pre>
  
  <p>What I'm getting is red in all cells, while I want only the cells that contain text in the "notes" column to display as red, while the empty ones should appear blue.</p>
  
  <p>Anybody able to help?</p>