I am trying to update something in my DB, but my problem is everything but 1 piece of infomation is set and so it cannot put the message with the correct ID. Basically, the user selects a story to update, it passees the ID tothe next page, this words as the url is id=1 and even on my page i echo $id and it clearly states 1. But it wont go in to my function..here is some code
First my function. Here we can see $resolved which is from a form and i changed from $POST['resolved'] to a localvar a few lines up and $id which is set via a $GET['id'] ealier on but i know this is set due it me echoing it in to the page. the echo statements are for debuggng and the rest as you see
function resolve($id,$resolved)
{
global $db;
echo "id is $id";
echo "message is $resolved";
$sql = "UPDATE NetworkStats SET resolved = '$resolved' WHERE id = '$id'";
$result = mysql_query($sql,$db);
return;
}
a few lines down is my main HTML page and here id is echoed and its echoed correct
<th width="90%" scope="col"><div align="left"><?php echo $id; ?></div></th>
at the very top of the page I have a recordset that gathers some more infomation according to the id which we will update in the function. I know here id works as the 2 peices of infomation are correctly pulled
$sql = "SELECT * FROM NetworkStats WHERE id = '$id'";
so it works at the top, at the bottom but not in the function even though the var $resolved does
any one see whats wrong
Thanks
Chris