代碼:如何顯示數據,如果一個字段具有整數值以及在php/mysql中的文本?
<?php
if($affiliated == '')
{
echo $affiliated;
}
else
{
$sql = "select * from all_university where university_id = '$affiliated'";
$result = mysqli_query($link,$sql);
while ($row = mysqli_fetch_array($result))
{
$short_name = $row['short_name'];
}
}
>
在我有數據庫表字段名下屬和具有不同行中兩個不同的值有「整」值一列,並有另一種「文本」的價值?。我想要顯示不同的值,即如果$ affiliated具有整數值,它會打印整數其他打印文本。那麼,我該如何解決這個問題呢?
謝謝
你嘗試過什麼到目前爲止,檢查我的意見? – hassan
你可以顯示你的嘗試@kevin –