Drupal 7 db_query how to return regular array from varchar field I am attempting to combine two arrays - one is stored in the database in a varchar field. Something like this.

["0","1","2","68","69","95","96","97","98","99","100"]


I am bringing in a similar array that comes from the front end.

["0","1","2","45","66","95","97","98","99","100"]


I need merging the two and remove duplicates.

   //merge post data and stored data
      $merge = array_merge($arr1, $arr2);
      //remove duplicates
      $merge = array_unique($merge);


My problem is that when retrieving the varchar field, I am not getting a normal array but an associative. Here is my code.

$arr2 = db_query('SELECT stats FROM {my_db} WHERE uid = :uid AND nid = :nid', array(':uid' =&gt; $usid, ':nid' =&gt; $noid))-&gt;fetchAll(PDO::FETCH_ASSOC);


I need this to return a regular array, not an associative to combine the two and remove duplicates. Does anyone know how?

When I do a print_r() on $arr2 it returns the following.

Array
(
    [0] =&gt; Array
        (
            [stats] =&gt; ["0","1","2","68","69","95","96","97","98","99","100"]
        )

)


I can't seem to be able to merge it and pass it to array_unique() on.
https://www.drupal.org/node/1251174

$arr2 = db_query('SELECT stats FROM {my_db} WHERE uid = :uid AND nid = :nid', array(':uid' =&gt; $usid, ':nid' =&gt; $noid))-&gt;fetchCol();

print_r($arr2[0]);