Question: I want something like this?

```
$sql = mysql_query("SELECT lid, ip FROM lua where uid='$uid'"); 
$rows = mysql_fetch_array($sql);
$ip = $rows['ip'];
$res = array('value 1 of $ip from datebase','value 2 of $ip from datebase','value 3 of $ip        from datebase.......');
?>

```

Is it possible?
help related this...thnxx..

Answer: 
```
$arr = array();
while ($rows = mysql_fetch_array($sql)) {
    array_push($arr,$rows['ip']); // and so on if you willing other values to be in your array
}
var_dump($arr); // test your array

```

**NOTE:** Though it's deprecated to use `mysql`, use `mysqli` or `pdo` extensions instead. See [this](https://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php/12860046) post about this issue
```
$result = mysql_query("SELECT ip FROM lua where uid='$uid'"); 
$ip = array();  
while ($ip[] = mysql_fetch_field($result));
$ip = array_filter($ip);

```