$sql="select * from tabla";$result = mysql_query($sql);while ($actual = mysql_fetch_assoc($result)) {$variable = $actual['nombre_campo'];}