title: store mysql results in SESSION array for later use (to check via in_array)
body: <p>I currently have this : 
  require_once('auth.php');</p>
  
  <pre><code>auth.php:
  
      session_start();
  
      if(!isset($_SESSION['SESS_MERCHANT_ID']) || (trim($_SESSION['SESS_MERCHANT_ID']) == '')) {
          header("location: login-form.php");
          exit();
      }
  
  mybadges.php:
          $mybadges = mysql_query("SELECT badge_id
          FROM badges WHERE merchant_id = $current_userid ORDER BY badge_id DESC"); 
  
      while ($result = mysql_fetch_array($mybadges)){
  
      $badge_id = $result['badge_id'];
  
      }
  </code></pre>
  
  <p>I wanted to know how I can store <code>$result['badge_id'];</code> in a $_SESSION array (like <code>$_SESSION['badges']</code>?) </p>