Jump to content

[SOLVED] Using POST


Daney11

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.