我想从使用PHP的条件匹配的SQL表中获取最小/最小ID,我尝试了以下代码但是发生了错误,即
尝试在第14行的/var/www/html/site/sitename/project-name.php中获取非对象的属性
任何建议都受到高度赞赏,而不是
$query = "select MIN(id) FROM project_view WHERE project_id = '$projectId' and email = '$email_in_cookie'";
$result = $con->query($query);
if( $result->num_rows > 0 )
{
$row = $result->fetch_assoc();
$sectionID = $row['id'];
}
echo $sectionID;