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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.