Mysql
 sql >> Base de données >  >> RDS >> Mysql

Comment afficher uniquement les champs non nuls dans mysql via php et HTML?

à l'intérieur de votre boucle while, utilisez pour chaque champ comme celui-ci (utilisez comme ceci pour tous les champs) :

while($row = mysqli_fetch_assoc($result))
   {

if($row['samplerecived']=="0000-00-00") $row['samplerecived']="";

echo "<tr>";
   echo "<br />";
echo "Department:".$row['dept'] ;
echo "<td>" . $row['samplerecived'] . "</td>";
   echo "<td>" . $row['molbioextraction'] . "</td>";
echo "<td>" . $row['molbioextractionqc'] . "</td>";
echo "<td>" . $row['libraryprep'] . "</td>";
   echo "<td>" . $row['libraryqc'] . "</td>";
echo "<td>" . $row['sequencing'] . "</td>";
echo "<td>" . $row['datacheck'] . "</td>";
   echo "<td>" . $row['resequencing'] . "</td>";
echo "<td>" . $row['qccheck'] . "</td>";
echo "<td>" . $row['analysisstarted'] . "</td>";
   echo "<td>" . $row['analysiscompleted'] . "</td>";
echo "<td>" . $row['report'] . "</td>";
echo "<td>" . $row['outbound'] . "</td>";
echo "</tr>";
}