我是PHP / MYSQL的新手,我试图使用DATEIFF
显示我数据库中所有记录的年龄,如我的代码第17行所示,但它刚赢了& #39;工作。我需要有人帮我解决这个问题。
$result = mysqli_query($con,"SELECT * FROM growers");
echo "<table class='table table-striped table-advance table-hover'>
<tbody>
<tr>
<th><i class='icon_profile'></i> Batch</th>
<th><i class='icon_ol'></i> Date Received</th>
<th><i class='icon_clock_alt'></i> Age when Received</th>
<th><i class='icon_clock_alt'></i> Current Age</th>
<th><i class='icon_star'></i> NO of Birds</th>
<th><i class='icon_info'></i> View More</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo"<tr>";
echo"<td>" . $row['BATCH'] . "</td>";
echo"<td>" . $row['BIRTH DAY'] . "</td>";
echo"<td>" . $row['AGE'] . " Week(s)" . "</td>";
echo"<td>" . "SELECT DATEDIFF("NOW()", "$row['BIRTH DAY']") AS CURRENT AGE". "</td>";
echo"<td>" . $row['NO OF BIRDS'] . "</td>";
echo"<td>" . $row['AGE'] . "</td>";
echo"</tr>";
}
echo "</table>";
mysqli_close($con);
?>
答案 0 :(得分:1)
您可以在主要选择中选择
{
"parameters" : [
{
"address1" : "2455 South Road",
"city" : "Poughkeepsie",
"companyName" : "IBM Research",
"state" : "NY",
"country" : "US",
"postalCode" : "12601",
"firstName" : "Justin",
"lastName" : "Manweiler",
"email" : "rismadm@us.ibm.com",
"permissionSystemVersion" : "1",
"timezoneId" : "117",
"username" : "cu-jmanweiler@us.ibm.com",
"secondaryPasswordTimeoutDays" : 90,
"userStatusId" : 1001
},
"IBMcl0ud!",
"IBMcl0ud!"
]
}