title: How to update HTML DIV from PHP conditional
body: <p>I am trying to update a HTML DIV dynamically while updating some information in a MySQL database, without reloading the page. How do I get this HTML DIV to update?</p>
  
  <pre><code>     echo "&lt;td id=\"trade_refs_update\"&gt;".(($results[$k]["trade_references_supplied"] == "Yes") ? "&lt;img src=\"images/checkmark.png\" width=\"20\" height=\"20\" /&gt;" : "")."&lt;/td&gt;";
  </code></pre>
  
  <p>Here's the PHP code:</p>
  
  <pre><code>    if(isset($_REQUEST["edit_app"]))
  {
  
  $columnname=$_REQUEST["column"];
  $value=$_REQUEST["editval"];
  
  if ($set_trade_references == 'Yes') {
      $sql_update=('UPDATE apps_data set `'.$columnname.'` = "'.$value.'", "trade_refs" = "Yes" WHERE app_id='.$app_id.';');
      echo "&lt;script&gt;$('#\"trade_refs_update\"').html('\"&lt;img src=\"images/checkmark.png\" width=\"20\" height=\"20\" /&gt;\"');&lt;/script&gt;";
  } else {
      $sql_update=('UPDATE apps_data set `'.$columnname.'` = "'.$value.'" WHERE app_id='.$app_id.';');
      echo "&lt;script&gt;$('#\"trade_refs_update\"').html('\"&lt;img src=\"images/error.png\" width=\"20\" height=\"20\" /&gt;\"');&lt;/script&gt;";
  }
  $results = $db_handle-&gt;executeQuery($sql_update);
  if ($DEBUG =='On'){
    echo "columnname: ".$columnname."&lt;BR&gt;";
      echo "value: ".$value."&lt;BR&gt;";
      echo "sql_update: ".$sql_update."&lt;BR&gt;";
  }
  }
  </code></pre>