Hi all,
I have a little problem with a Update statement in a Query:
I have form that. will get his info from a other page i retrieve that info with a get.
PHP will fill out the form perfectly. but when i save MySQL complains that there is a error in my statement on line one:
This is the line:
$klanten = "Update $tabel values ('$naam', '$geleend', '$media', '$genre', '$omschrijving', '') WHERE id='$idf'";
This is the Code.
<?php
include("securewrite.php");
?>
<?php require_once('database.php'); ?>
<?php if (isset($_POST['naam']))
{
$naam = strip_tags($_POST['naam'], '');
$media = strip_tags($_POST['media'], '');
$genre = strip_tags($_POST['genre'], '');
$omschrijving = strip_tags($_POST['omschrijving'], '');
$geleend = $_POST['geleend'];
$idf = strip_tags($_POST['idfield'], '');
// database gedeelte
mysql_connect("$hostname", "$user", "$password") or die("Kan geen verbinding maken: " . mysql_error());
mysql_select_db("$db");
$klanten = "Update $tabel values ('$naam', '$geleend', '$media', '$genre', '$omschrijving', '') WHERE id='$idf'";
mysql_query($klanten) or die(mysql_error());
mysql_query("COMMIT");
echo "$toegevoegdinmailing";
exit;
}
?>
Thnx For your help 🙂