вы можете использовать код из первого примера здесь .
$sql = "SELECT id as userid, fullname, userstatus
FROM sometable
WHERE userstatus = 1";
$result = mysql_query($sql);
// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
// then create $userid, $fullname, and $userstatus
$values = array();
while ($row = mysql_fetch_assoc($result)) {
$values[] = $row["fullname"];
}