Mailinglisten-Archive |
Carl Slowinski schrieb: > Hallo ihr hallo du ;) wenn ich das richtig verstanden habe, hier mein Vorschlag: $selected_games = unserialize($row['games']); $query = mysql_query("SELECT distinct * FROM games ORDER BY games_name"); while($rows = mysql_fetch_assoc($query)) { $games_id = $rows['games_id']; $games_name = $rows['games_name']; /* suche ob augewählt */ if(is_array($selected_games)) { foreach($selected_games as $game) { //echo "$game"; if($game == $games_id) { $select = 'selected'; } else { $select = ''; } } } else { /* sollte $selected_games kein Array sein hier noch erweitern */ } echo "<option $select value=\"$games_id\">$games_name</option>"; } ?> </select> -- Jan Heppe http://www.afvm.de/
php::bar PHP Wiki - Listenarchive