prepare("SELECT i.image_id, i.image_path, sq.status AS square_status, sq.zone_id AS square_zone, sq.title AS square_title FROM images i LEFT JOIN photos_square sq ON sq.image_id = i.image_id WHERE i.user_id = ? AND i.is_deleted = 0 ORDER BY i.image_id DESC"); $stmt->bind_param("i", $user['user_id']); $stmt->execute(); $images = $stmt->get_result()->fetch_all(MYSQLI_ASSOC); $stmt->close(); $count = count($images); $points = (int)$user['points']; render_header('我的图库', $user, 'gallery.php', '共 ' . $count . ' 张图片'); ?>