I am trying to use the below to update a MySQL DB. I connect fine and get no errors when submitting a change yet the DB is not showing any changes. Any thoughts?
<?php
//replace usernaem,password, and yourdb with the information for your database
mysql_connect("######","######","######") or die("Error: ".mysqlerror());
mysql_select_db("#####");
//get the variables transmitted from the form
$id = $_POST['id'];
$trailName = $_POST['trailName'];
$trailDesc = $_POST['trailDesc'];
$trailHike = $_POST['trailHike'];
$trailBike = $_POST['trailBike'];
// update data in mysql database
$sql="UPDATE markers SET trailName='$trailName', trailDesc='$trailDesc', trailHike='$trailHike' WHERE id='$id'";
mysql_query($sql) or die ("Error: ".mysql_error());
echo "Database updated. <a href='edit.php'>Return to edit info</a>";
?>
It is probably because the where clause in the update statement is not finding the id you are passing it.