I have a simple query with outputs only one column (rows number may change)

```
SELECT column1 as NUMBER WHERE column1 ...

```

Output, 

```
NUMBER
  1
  2

```

I just want it as an array in PHP with them as comma seperated.

So I did, 

```
$rows = array();
while ($row = mysql_fetch_row($result)) {
    $rows[] = $row;

```

and its working if I echo it with print\_r

However because of some reason I cant get the plain values out of this array.

echo $rows[0] gives me the word 'Array'

echo implode(",", $rows); gives me 1Array',Array1

I tried 

```
echo json_encode($rows[0]);

```

gives me

```
["1"]

```

I simply want 1,2

After a lot of different tries I gave up and added group\_concat in the sql query. I just want to know what I did wrong.

Thanks.