I have constructed the following query
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO selection (student_id, id_project, level_of_want)
VALUES ((SELECT id FROM users WHERE Username = ".$_SESSION['MM_Username']." ), %s, %s)",
GetSQLValueString($_POST['Project_id'], "int"),
GetSQLValueString($_POST['Want'], "text"));
mysql_select_db($database_projectsite, $projectsite);
$Result1 = mysql_query($insertSQL, $projectsite) or die(mysql_error());
}
The student_id comes from the session information that is compared in the table.
The id_project comes from a hidden field that should contain the current id, and the level_of_want comes from the two submit button. When one is selected, that value is applied to the database. Below is how that looks in the form.
<input type="submit" name="Want[]" id="Want_0" value="Really Want" />
<input type="submit" name="Want[]" id="Want_1" value="Partially Want" />
</p>
<p>
<input name="Project_id" type="hidden" id="Project_id" value="<?php echo $row_Test['Project_id']; ?>" />
</p>
However when i execute this no information is applied to the database, nor is an error message shown when the button is selected. Does anyone have any possible clue to whats wrong?