title: Store mysql column to array PHP
body: <p>I use this to get a column named "device_token" and save the values to an array:</p>
  
  <pre><code>mysql_connect("localhost", "xxxx", "xxxx") or die ("Not connected");
  mysql_select_db("xxxxx") or die ("no database");
  $query = "SELECT xxxx_device_token FROM device_tokens";
  
  
  $result_array = array();
  while($row = mysql_fetch_assoc($result))
  {
      $result_array[] = $row['xxxx_device_token'];
  }
  print_r($result_array);
  </code></pre>
  
  <p>But all I get is an empty array, what is the problem ? </p>