Hey, I'm trying to add data from a drop down menu into my database... But What I did does not work.
PHP:
<?php
if(isset($_POST['save']))
{
$itemn = $_POST['itemn'];
$realm = $_POST["realm"];
if(!get_magic_quotes_gpc())
{
$itemn = addslashes($itemn);
}
$query = " INSERT INTO items (itemn, realm) ".
" VALUES ('$itemn, '$realm')";
mysql_query($query) or die('Error ,query failed');
echo "'$itemn' on '$realm' added";
}
?>
<form method="post">
<table width="700" border="0" cellpadding="2" cellspacing="1" align="center">
<tr>
<td width="100">Item Name</td>
<td><input name="itemn" type="text"></td>
</tr>
<tr>
<td width="100">Realm</td>
<td>
<select name="realm">
<option value="------" >Select one</option>
<option value="Us.East N-L Sofcore">Us.East N-L Sofcore</option>
<option value="Us.East N-L Hardcore">Us.East N-L Hardcore</option>
<option value="Us.East L Softcore">Us.East L Softcore</option>
<option value="Us.East L Hardcore">Us.East L Hardcore</option>
<option value="Us.West N-L Sofcore">Us.West N-L Sofcore</option>
<option value="Us.West N-L Hardcore">Us.West N-L Hardcore</option>
<option value="Us.West L Softcore">Us.West L Softcore</option>
<option value="Us.West L Hardcore">Us.West L Hardcore</option>
<option value="Europe N-L Sofcore">Europe N-L Sofcore</option>
<option value="Europe N-L Hardcore">Europe N-L Hardcore</option>
<option value="Europe L Softcore">Europe L Softcore</option>
<option value="Europe L Hardcore">Europe L Hardcore</option>
<option value="Asia N-L Sofcore">Asia N-L Sofcore</option>
<option value="Asia N-L Hardcore">Asia N-L Hardcore</option>
<option value="Asia L Softcore">Asia L Softcore</option>
<option value="Asia L Hardcore">Asia L Hardcore</option>
</select>
</td>
</tr>
</table>
<input name="save" type="submit" value="Save Item">
</form>