所以这仍然保持返回1(最大值为1),当我在phpmyadmin中运行查询时,我得到2。
function getListingID(){
global $servername, $username, $password, $dbname;
$conn = mysqli_connect($servername, $username, $password, $dbname);
$result = $conn->query("SELECT 1, MAX(position)+1 FROM listings");
$row = mysqli_fetch_row($result);
return $row[0];
}
感谢任何帮助。谢谢!
答案 0 :(得分:4)
您应该返回索引1
以获取MAX(position)+1
(第二列索引= 1
)
return $row[1];
答案 1 :(得分:1)
将查询字符串更改为:
model.predict(imgs)
array([[ 1.00000000e+00, 1.34882026e-08, 3.92139575e-22],
[ 0.00000000e+00, 1.00000000e+00, 0.00000000e+00],
[ 8.70998792e-06, 5.31159838e-10, 9.99991298e-01]], dtype=float32)