title: MySql While Loop to Assign Variables
body: <p>I'm trying to create a table that shows the outputs of a mysql query. However, if the result on a row of the query is equal to the default <code>null</code> <code>00:00:00</code> then I'd like to instead display <code>''</code>. Unfortunately, my code for whatever reason changes all of the entries to <code>''</code> if there exist any <code>00:00:00</code> in the query.  I expect the issue is with the variable not being redefined during the loop, but I am not completely sure. I appreciate any help. PHP script is as follows:</p>
  
  <pre><code>$table = "&lt;ul data-role='listview' data-theme='b' id='myTabDiv'&gt;";
   while($row = mysqli_fetch_assoc($res)){ 
    $actdep = $row['actdep'];
  
    if($row['actdep'] = '00:00:00'){
         $actdep = '';
    }
  
   $table .=  "&lt;li&gt;&lt;table style='table-layout: fixed; width: 100%'&gt;&lt;tr&gt;&lt;td&gt;" . $actdep . "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/li&gt;";
  
   };
  $table .= "&lt;/ul&gt;";
  echo $table;
  </code></pre>
  
  <p>If you comment out the 6th line (<code>$actdep = '';</code>) then all the values show, otherwise none of them do. Only one value in the table has a time of <code>00:00:00</code>.</p>