PDA

Click to See Complete Forum and Search --> : Php ?


Neballer
03-01-2007, 05:59 AM
<?
import_request_variables('gpc');
include("connect_inc.php");
$query = "UPDATE diesel SET pic_name='$pic_name', date='$date', ";
$query .= "camera='$camera', category='$category', words='$words', topfive='$topfive' ";
$query .= "WHERE id='$id'";
if (mysql_query($query)) {
header("Location:delete_file.php?message=$id, $query more stuff after teh query");
//header("Location: delete_file.php?message=$row[id] - $pic_name: updated");
exit();
}
header("Location: delete_file.php?message=update failed: $query");
exit();
?>

For some reason $id always = 2. It is coming in with the rest of the data on the import_request_variables, and all of that data is correct as well as the form it is coming from.

Any ideas?

Benjamin
03-01-2007, 09:13 AM
I might be totally missing the point here, but it looks like your variable is being sent as ?message=$id. If this is the case, then wouldn't you need to retrieve the $id by referring to the keyword 'message'?

$id = $_POST['message']

or somethign like that?

Neballer
03-01-2007, 11:31 PM
Didn't really explain this that well.

The only reason I'm sending $id is to test it.
This is an action for a form that updates content based on it's id in the database. The query returns true - but for some reason no matter what, the id is always 2

Neballer
03-05-2007, 04:49 PM
if it makes anybody feel better, It works now :D