Hi all
I am posting page/form and the unique value that is needed to update a record in my DB is not being passed - can someone point me in the right direction of why please?
Here is my code :
$vacancyid = $_GET['vid']; //this gets passed from a previous page first
if ($POST['jobtitle']) {
$jobtitle = $POST['jobtitle'];
$jobref = $_POST['jobref'];
$sqlupdatequery = "UPDATE tblvacancies SET jobtitle = '$jobtitle', jobref = '$jobref' WHERE vacancyid = $vacancyid";
$updateresult = mysql_query($sqlupdatequery);
}
// here i select the data when the page opens and after posting
$sqlquery = "SELECT * FROM tblvacancies WHERE vacancyid = $vacancyid";
$dataresult = mysql_query($sqlquery);
while ($datarow = mysql_fetch_array($dataresult)) {
$vacancyid = $datarow['vacancyid'];
$jobtitle = $datarow['jobtitle'];
$jobref = $datarow['jobreference'];
}
mysql_free_result($dataresult);
// my form is here
<form id="updatevacs" name="updatevacs" method="post" action="editvacancies.php">
// form elements here..
< a submit button here >
<input name="vid" type="hidden" value="<?php echo $vacancyid; ?>">
</form>
What am I doing wrong?
Thanks