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 null 00:00:00 then I'd like to instead display ''. Unfortunately, my code for whatever reason changes all of the entries to '' if there exist any 00:00:00 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:
$table = "<ul data-role='listview' data-theme='b' id='myTabDiv'>";
while($row = mysqli_fetch_assoc($res)){
$actdep = $row['actdep'];
if($row['actdep'] = '00:00:00'){
$actdep = '';
}
$table .= "<li><table style='table-layout: fixed; width: 100%'><tr><td>" . $actdep . "</td></tr></table></li>";
};
$table .= "</ul>";
echo $table;
If you comment out the 6th line ($actdep = '';) then all the values show, otherwise none of them do. Only one value in the table has a time of 00:00:00.