Updating Database Problem
Hi, I've been having quite a bit of trouble figuring out why my database is not being updated as a result of the following code:
<?php
/* Updates any information in that has been altered
by the user via the Edit option */
$NAME=$_POST['updateNAME'];
$MAC=$_POST['updateMAC'];
$IP=$_POST['updateIP'];
$LOCATION=$_POST['updateLOCATION'];
$VIRUS=$_POST['updateVIRUS'];
$VERSION=$_POST['updateVERSION'];
$NOTES=$_POST['updateNOTES'];
$currentID=$_POST['currentID'];
$sql = "UPDATE info SET NAME='$NAME',
MAC='$MAC',
IP='$IP',
LOCATION='$LOCATION',
VIRUS='$VIRUS',
VERSION='$VERSION',
NOTES='$NOTES'
WHERE ID=$currentID";
?>
ID is the primary key. When I echo out the vars and the sql I am getting the right information, however, my DB isn't updating. I can't figure it out because I have other include_once('filename') which work fine in the program and correctly display data, allow me to search, etc. I have tried many variations on altering the $currentID but it doesn't seem to make much difference. I am guessing it is a syntax problem, but after having worked on this page for god knows how many hours today, I am going nuts and can't see where my error is although it is likely very simple. Please help!
|