在php中创建一个循环以在查询中工作

i'm building this little function,

what i need is this query to print me values. Which means, i have this array named $checked1 which i need to print each of it inside a query.

My code up to now is:

$result = mysql_query("SELECT $checked FROM hostess");


while($row = mysql_fetch_array($result))
  {foreach( $checked1 as $key => $value){

      echo "<td>" . $row['$value'] . "</td>";


}

But it's not working.

Can you tell me what's wrong?

Thanks..

echo "<td>" . $row['$value'] . "</td>";

should be

echo "<td>" . $row[$value] . "</td>";