PHP refuses to read one of my variables in a MySQL query
I'm using $_GET to grab an id from the URL and then storing this in a variable called $taskid like so:
$taskid = $_GET['id'];
This works fine, however earlier in my code I have an UPDATE SQL statement that updates the task when the submit button is pressed, which looks like this:
$updatelist = "UPDATE list SET name='".$_POST['name']."' WHERE taskid = '$taskid'";
$result = mysql_query($updatelist);
For some reason the query does nothing as it fails to read the $taskid variable. However the variable is read with no problem further down in the code. I've tried re-declaring the variable above the query with no luck.
I will be HUGELY appreciative to anyone that can provide any help, this problem has been driving me up the wall for a while. Thanks!