title: Why is my member id column returning null?
body: <p>For some reason the member id field(auto inc.) in my huge query is returning null.I've tried every which way of selecting it... m.member_id AS member_id, etc.I cannot figure out why it is returning null when there is a value for that field in the table.</p>
  
  <pre><code>&lt;?php    
  public function get_info($criteria = 0){            
          if(is_numeric($criteria)){
              $where = "WHERE m.member_id = ".$criteria;
          } else {
              $where = "WHERE email_address = '".$criteria."'";
          }
          $query_member = "
              SELECT
                  m.member_id AS member_id, m.display_name, m.email_address, m.group_id, m.status, m.activation_code, UNIX_TIMESTAMP(m.date_joined) AS date_joined,
                  m.gender, m.location, m.biography, m.mantra, m.birth_date, m.results_per_page, m.admin_emails, m.member_emails, m.last_active, m.avatar_id, 
                  m.banner_id, m.signature, m.newsletter_subscription, m.recruiting_status, m.facebook_username, m.website, m.steam_username, m.xboxlive_gamertag, m.psn_id,
                  g.group_id, g.title, g.description,
                  a.attachment_id, a.file_name,      
                  f.message_id, f.author_id, COUNT(f.message_id) AS forum_count,  
                  b.attachment_id AS banner_id, b.file_name AS banner_file,
                  mr.request_id, mr.author_id, mr.recipient_id, mr.status, COUNT(mr.request_id) AS total_friends,
                  tm.team_member_id, tm.member_id, tm.team_id
              FROM members AS m
              LEFT JOIN member_groups AS g ON (m.group_id = g.group_id)   
              LEFT JOIN attachments AS a ON (m.avatar_id = a.attachment_id)         
              LEFT JOIN forum_messages AS f ON (m.member_id = f.author_id)
              LEFT JOIN attachments AS b ON (m.banner_id = b.attachment_id)
              LEFT JOIN member_requests AS mr ON (m.member_id = mr.author_id OR m.member_id = mr.recipient_id) AND mr.status = 1
              LEFT JOIN team_members AS tm ON (m.member_id = tm.member_id) AND date_left = ''
              ".$where."
              GROUP BY m.member_id
              LIMIT 1";     
  
          //show_error($query_member);    
          if($query_member = $this-&gt;db-&gt;query($query_member)){            
              if($query_member-&gt;num_rows() &gt; 0){                    
                   var_dump($query_member-&gt;row_array());
  </code></pre>