Forum Moderators: coopster
here is the code,
// -- Query to update db => I had to clean this query up quite a bit, no need to assign it to a variable
mysql_query("UPDATE ads SET
title = '" . $title . "',
category = '" . $category . "',
location = '" . $location . "',
body = '" . $body . "',
contact = '" . $contact . "',
email = '" . $email . "',
telephone = '" . $telephone . "',
end = '" . $end . "',
date ='" . $date . "',
author ='" . $author . "' WHERE id = " . $id) or die("Not connecting");
// -- Give a success message => Why use a die() for this? A simple echo will do just fine
die(", <p>Your post has been edited</p><a href='index.php'> Home page</a>");
} else {
echo "<p>Please complete all fields</p>";
}
}
mysql_query("UPDATE ads SET
title = '" . $title . "',
category = '" . $category . "',
location = '" . $location . "',
body = '" . $body . "',
contact = '" . $contact . "',
email = '" . $email . "',
telephone = '" . $telephone . "',
end = '" . $end . "',
date ='" . $date . "',
author ='" . $author . "' WHERE id = " . $id) or die(mysql_error());
Let me know if you get any mysql error from this now.
like this
mysql_query("UPDATE ads SET
`title` = '" . $title . "',
`category` = '" . $category . "',
`location` = '" . $location . "',
`body` = '" . $body . "',
`contact` etc etc