Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10846

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.11-RC1
    • 3.0.10
    • ACP
    • None

      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);

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

              Created:
              Updated:
              Resolved: