title: Error: Unknown column 'Array' in 'field list'
body: <p>i got Error: Unknown column 'Array' in 'field list' when trying to execute the process..I'm still new to php so i would like to know what is the problem with my coding.</p>
  
  <p>this is the coding first.</p>
  
  <pre><code>&lt;?php
  include("dbconnect.php");
  
  
  $q = mysql_query("SELECT bachok_qtt FROM bachok WHERE bachok_type = 'pants' ");
  if(is_resource($q) and mysql_num_rows($q)&gt;0)
  {
      $r = mysql_fetch_array($q);
      $r["bachok_qtt"];
  }
  
  $w = mysql_query("SELECT bachok_qtt FROM bachok WHERE bachok_type = 'clothes' ");
  if(is_resource($w) and mysql_num_rows($w)&gt;0)
  {
      $s = mysql_fetch_array($w);
      $s["bachok_qtt"];
  }       
  
  $e = mysql_query("SELECT stock_qtt FROM stock WHERE stock_type = 'pants' ");
  if(is_resource($e) and mysql_num_rows($e)&gt;0)
  {
      $a = mysql_fetch_array($e);
      $a["stock_qtt"];
  }    
  
  $t = mysql_query("SELECT stock_qtt FROM stock WHERE stock_type = 'clothes' ");
  if(is_resource($t) and mysql_num_rows($t)&gt;0)
  {
      $b = mysql_fetch_array($t);
      $b["stock_qtt"];
  }    
  
  
  if ($r &lt; $a)
  {
      if($s &lt; $b)
      {
          $sql1 = "UPDATE stock SET stock_qtt = stock_qtt - $r  WHERE stock_type = 'pants' ";
          $sql2 = "UPDATE stock SET stock_qtt = stock_qtt - $s  WHERE stock_type = 'clothes' ";
  
          $result1 = mysql_query($sql1) or die ("Error: " . mysql_error());
          $result2 = mysql_query($sql2) or die ("Error: " . mysql_error());
  
          if($result1)
          {
              if($result2)
              {
              echo "Successful";
              echo "&lt;br&gt;";
              echo "&lt;a href='admin2.php'&gt;Back to main page&lt;/a&gt;";
              }
          }
          else 
          {
              echo "ERROR";
          }
      }
  }
  else
  {
      echo "Not enough stock";
      echo "&lt;br&gt;";
      echo "&lt;a href='admin2.php'&gt;Back to main page&lt;/a&gt;";
  }
  
  
  
  
  ?&gt; 
  </code></pre>
  
  <p>So, why does it throw unknown column array when executed..Hav I used MySQL_fetch_array() correctly?</p>