我需要幫助如何添加一個「if else」語句到我的PHP腳本,我需要new_license_issued_date
字段爲空,如果爲空,而不是01/01/1970
像它目前正在拉動....請幫忙!謝謝添加PHP,如果其他人的代碼
<table cellpadding='0' cellspacing='0' border='0' class='display' id='table' width='100%'>
<thead>
<tr>
<th>Emp Code</th>
<th width='130'>Emp Name</th>
<th width=100>Manager</th>
<th width=150>Business Unit</th>
<th width=240>Training Course Name</th>
<th width=65>Issued Date</th>
<th width=65>Expiry Date</th>
<th width=100>Cert Number</th>
</tr>
</thead>
<tbody>
<?php
//display the results
while($row = mssql_fetch_array($result))
{
echo "<tr>
<td width=40>" . $row['Emp Code'] . "</td>
<td>". $row['new_EmployeeName'] . "</td>
<td>". $row['Manager'] . "</td>
<td>". $row['BusinessUnit'] . "</td>
<td>". $row['new_TrainingCourseLookName'] . "</td>
<td>". date('d-M-Y', strtotime($row['new_license_issued_date'])) . "</td>
<td>". date('d-M-Y', strtotime($row['new_license_expiry_date'])) . "</td>
<td>". $row['new_license_no'] . "</td>
</tr>";
}
echo "</tbody>
</table>
<br>
<p><a href='index.php'><< Back to Portal</p>
</div>";
//close the connection
mssql_close();
?>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" language="javascript" src="assets/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="assets/js/jquery.dataTables.js"> </script>
<script type='text/javascript' charset='utf-8'>
$(document).ready(function() {
$('table').dataTable();
});
</script>
</body>
</html>
省長,非常感謝你:-) – 2014-09-30 10:35:42
不客氣@JohnOwen – 2014-09-30 10:38:37