I'm not able to update my fields. Where am I going wrong?
I get the id
through GET
and I can display the data in the table, but I can not update it.
FIELDS
$id_destino = $_GET['id_destino'];
$destino = mysql_real_escape_string($_POST['destino']);
$historia = mysql_real_escape_string($_POST['historia']);
$geografia = mysql_real_escape_string($_POST['geografia']);
$clima = mysql_real_escape_string($_POST['clima']);
$cultura = mysql_real_escape_string($_POST['cultura']);
if($_POST['enviar']) {
$sql = mysql_query("UPDATE 'destinos_pt' SET destino = '$destino', historia = '$historia', geografia = '$geografia', clima = '$clima', cultura = '$cultura' WHERE id_destino = '$id_destino'");
header("Location: dashboard.php");
}
FORM
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="destinosform" novalidate role="form">
</form>
What's wrong that I can not update my table ?