无法从查询中提取 $row['PID'] 的值...
$result = mysqli_query($con,"SELECT * FROM posts WHERE PID=(SELECT max(PID) FROM posts)");
$row = mysql_fetch_array($result);
$id = $row['PID'];
我知道如何打印出来:
while($row = mysqli_fetch_array($result))
{
echo $row['PID'];
}
但不知道如何将它分配给一个变量而不必打印出来......