Hi all,
This following code doesnt update the database. I get the following error message
Parse error: parse error in C:\wamp\www\testbin\edit.php on line 41
Please can you advise as to the error. I have worked on this for a few hours now but to no avail.
Many thanks
<?php
if (isset($_POST['$SUBMIT'])):
// The author's details have been updated.
$Title = $_POST['Title'];
$Subtitle = $_POST['Title'];
$Content = $_POST['Content'];
$Author = $_POST['Author'];
$Date = $_POST['Date'];
$id = $_POST['id'];
$sql = "UPdATE indexinfo SET
Title='$Title',
Subtitle='$Subtitle',
Content='$Content',
Author='$Author',
Date='$Date'
WHERE id='$id'";
if (@mysql_query($sql)) {
echo '<p>Author details updated.</p>';
} else {
echo '<p>Error updating author details: ' .
mysql_error() . '</p>';
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<p>Edit the author:</p>
<label>Title: <input type="text" name="Title" value="<?php echo $Title; ?>" /></label><br />
<label>Subtitle: <input type="text" name="Subtitle" value="<?php echo $Subtitle; ?>" /></label><br />
<label>Content: <input type="text" name="Content" value="<?php echo $Content; ?>" /></label><br />
<label>Author: <input type="text" name="Author" value="<?php echo $Author; ?>" /></label><br />
<label>Date: <input type="text" name="Date" value="<?php echo $Date; ?>" /></label><br />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="submit" value="SUBMIT" /></p>
</form>