患者编号:1,2,3,4,5,6,7,8,9,10
$result2=mysql_query("select max(patient_id) as maximum from outdoor");
$row2= mysql_fetch_array($result2);
echo $res=$row2['maximum'];
它的最大数量为 9 而不是 10。
最佳答案
试试这个
$sql = "select max(CONVERT(patient_id,UNSIGNED INTEGER)) as maximum from outdoor";
关于php - 最大数计算错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25305978/