I am trying to create an update page which uses a form to update the details in an oracle table. I am getting an undefined index on two of the columns, OCI8 and oracle are fairly new to me so not 100% sure what I am doing.
Here is my code:
<?php
$conn = oci_connect("xxxxx", "xxxxxx", "xxxxxx");if(count($_POST)>0) {
$query=oci_parse($conn, "UPDATE AUTOMATEDAIVEHICLE SET APPLICATIONID='" . $_POST['APPLICATIONID']."', Application Name='" . $_POST['Application Name']."', TYPEOFVEHICLEID='" . $_POST['TYPEOFVEHICLEID']."', Type Of Vehicle Descripton='" . $_POST["Type Of Vehicle Description"]."'");
$result=oci_execute($query, OCI_DEFAULT);
if($result)
{
oci_commit($conn);
echo "Data Updated Successfully !";
}
else{
echo "Error.";
}
}
$query="SELECT * FROM AUTOMATEDAIVEHICLE WHERE VEHICLEID='" . $_GET['VEHICLEID'] . "'";
$result=oci_parse($conn,$query);
oci_execute($result);
$row=oci_fetch_array($result);
?>
<html>
<head>
<title>Update Type Of Vehicle</title>
</head>
<body>
<form name="frmAWFID" method="post" action="">
<div><?php if(isset($message)) { echo $message; } ?>
</div>
<div style="padding-bottom:5px;">
<a href="view.php">Index Page</a>
</div>
Application ID: <br>
<input type="text" name="APPLICATIONID" value="<?php echo $row['APPLICATIONID']; ?>">
<br>
Application Name: <br>
<input type="text" name="Application Name" value="<?php echo $row['Application Name']; ?>">
<br>
Type of Vehicle ID: <br>
<input type="text" name="TYPEOFVEHICLEID" value="<?php echo $row['TYPEOFVEHICLEID']; ?>">
<br>
Type Of Vehicle Description :<br>
<input type="text" name="Type Of Vehicle Description" value="<?php echo $row['Type Of Vehicle Description']; ?>">
<br>
<input type="submit" name="submit" value="Submit" class="button">
</form>
</body>
</html>
I believe it may be an issue with my sql however I am not completely sure, all of the table and column names are correct.
Any help will be much appreciated.