Daney11 Posted February 22, 2008 Share Posted February 22, 2008 Hey guys Im currently using <select class="forminput" name="server_game"> <?php $gamequery=mysql_query("SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC"); while($row_games=mysql_fetch_array($gamequery)){ echo "<option value=\"{$row_games['game_name']}\""; echo ">{$row_games['game_name']}</option>\n"; } ?> </select> It works fine but after the form has been submitted, the options dissappear..... Any ideas? Link to comment https://forums.phpfreaks.com/topic/92495-solved-using-post/ Share on other sites More sharing options...
budimir Posted February 22, 2008 Share Posted February 22, 2008 Where do you redirect after POST? Link to comment https://forums.phpfreaks.com/topic/92495-solved-using-post/#findComment-473907 Share on other sites More sharing options...
PHP Monkeh Posted February 22, 2008 Share Posted February 22, 2008 Try adding mysql_error() on your query to see if it's generating any errors after you submit: $gamequery=mysql_query("SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/92495-solved-using-post/#findComment-473908 Share on other sites More sharing options...
Daney11 Posted February 22, 2008 Author Share Posted February 22, 2008 Try adding mysql_error() on your query to see if it's generating any errors after you submit: $gamequery=mysql_query("SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC") or die(mysql_error()); when i add the or die bit my page breaks and doesnt show me an error. :S and the page stays as it is after posting. Link to comment https://forums.phpfreaks.com/topic/92495-solved-using-post/#findComment-473911 Share on other sites More sharing options...
Daney11 Posted February 22, 2008 Author Share Posted February 22, 2008 Ive got it working now Im using <select class="forminput" name="server_game"> <?php $gamequery = "SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC"; $gameresult = mysql_query($gamequery, $connect) or die(mysql_error()); while($row_games=mysql_fetch_array($gameresult)){ echo "<option value=\"{$row_games['game_name']}\""; echo ">{$row_games['game_name']}</option>\n"; } ?> </select> Thanks anyway guys. Link to comment https://forums.phpfreaks.com/topic/92495-solved-using-post/#findComment-473912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.