<?php
include "dbConfig.php";
$sql_query = mysql_query("SELECT SubjectID, SubjectDesc, FROM tbl_subject");
?>
<select name="X" value="X">
<option value="Choose">Choose</option>
<?php
while($fetch = mysql_fetch_array($sql_query))
{ ;
?>
<option value="<?php $fetch['SubjectID'];?>" selected="selected"><?php echo $fetch['SubjectID']; ?></option>
<?php
}
?>
</select>
INSERT code
<?php
include "dbConfig.php";
$Y = $_POST["Y"];
$query="INSERT into tbl_subjectsenrolled(SubjectID) values('".mysql_real_escape_string($Y)."')";
?>
But I cannot INSERT the SubjectID inside tbl_subjectsenrolled..