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? Quote 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? Quote 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()); Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/92495-solved-using-post/#findComment-473912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.