I am try to delete a DB record that is supposed to be passed by $_POST.
Here is my form:
The problem is that such a query:
$qryDeleteFeature = "DELETE FROM tblFeature WHERE id_Feature = '" . $_POST['features'] . "'";
Produces empty "id_feature":
DELETE FROM tblFeature WHERE id_Feature = ''
And looping through $_POST elements like this:
foreach ($_POST as $element) echo $element;
ptints only the value of the btnDelete: "Delete Checked", but the value of txtNewFeature doesn't appear to be set.
What am I doing wrong?
Here is my form:
Code:
<form method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>" ><br />
<table>
<tr>
<td><input type="submit" name="btnDelete" id="btnDelete" value="Delete Checked"></td>
</tr>
<tr><td colspan="2"><hr /></td></tr>
<tr>
<td><input type="text" name="txtNewFeature" width="30" size="20" value=""></td>
<td><input type="submit" name="btnAdd" id="btnAdd" value="Add New Feature"></td>
</tr>
</table>
</form>
The problem is that such a query:
$qryDeleteFeature = "DELETE FROM tblFeature WHERE id_Feature = '" . $_POST['features'] . "'";
Produces empty "id_feature":
DELETE FROM tblFeature WHERE id_Feature = ''
And looping through $_POST elements like this:
foreach ($_POST as $element) echo $element;
ptints only the value of the btnDelete: "Delete Checked", but the value of txtNewFeature doesn't appear to be set.
What am I doing wrong?