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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.0.10
    • 3.0.11-RC1
    • ACP
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: