Над изображением находится запись данных в базе данных mysql.
Над изображением был вывод, который я получаю,
Но мне нужно отображать только ненулевые поля в качестве результата, который означает, что столбец «пример возрожден» соответствует столбцу «library qc».
PHP-скрипт
<?php $userinput1 = $_POST['soid']; $servername = "localhost"; $username = "root"; $password = ""; $dbname = "status"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_errno) { printf("Connect failed: %s\n", $conn->connect_error); exit(); } $result = mysqli_query($conn, "SELECT * FROM $dbname.statusinfo WHERE soid = '$userinput1' ") or die(mysqli_error ($conn)); echo "<p><font size= 4>SO_NUMBER:$userinput1"; echo "<table border='1'> <tr> <style> th{ color: blue; } td{ color: black; } </style> <th>Sample Recived</th> <th>Mol-Bio Extraction</th> <th>Extraction QC</th> <th>Library Prep</th> <th>Library QC</th> <th>Sequencing</th> <th>Data Check</th> <th>RE Sequencing</th> <th>QC Check</th> <th>Analysis Started</th> <th>Analysis Completed</th> <th>Report</th> <th>Outbound</th> </tr>"; while($row = mysqli_fetch_assoc($result)) { 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>"; } echo "</table>"; ?>