I'm trying out PHP for the first time and I'm having difficulties passing a <select>
value.
Here's the code :
<select name="progress">
<option value="" disabled selected><?php echo $row['percent']; ?> </option>
<option value="50%">50%</option>
<option value="75%">75%</option>
<option value="100%">100%</option>
</select>
So I was trying to pass it with this code (based on some posts, it is how to do it) :
<a href="jobstatus.php?ID=<?php echo $row['id']; ?>&PR=<?php echo $_POST["progress"]; ?>"> Update</a>
And this is how I'm trying to get the values on jobstatus.php :
$id = $_GET['ID'];
$pr = $_GET['PR'];
$sql = "UPDATE FROM status SET percent = '$pr' WHERE id = '$id'";
It does not update my database, hence I'm being redirected to my error page.
Any links for tutorial and correct ways of coding this would be much appreciated! Cheers!
UPDATE FROM
is incorrect. UPDATE
is all you need.
Also obligatory xkcd reference