Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10846

Missing alias for MAX(post_id) in SQL query in acp_main.php

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.10
    • Fix Version/s: 3.0.11-RC1
    • Component/s: ACP
    • Labels:
      None

      Description

      The code

      $sql = 'SELECT MAX(post_id)
      FROM ' . POSTS_TABLE;
      $result = $db->sql_query($sql);
      $max_post_id = (int) $db->sql_fetchfield('max_post_id');
      $db->sql_freeresult($result);

      should be

      $sql = 'SELECT MAX(post_id) as max_post_id
      FROM ' . POSTS_TABLE;
      $result = $db->sql_query($sql);
      $max_post_id = (int) $db->sql_fetchfield('max_post_id');
      $db->sql_freeresult($result);

        Attachments

          Activity

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              StevieWonderer StevieWonderer [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: