MySQL Update won't work [SOLVED]
Posted: Sat Jul 22, 2006 4:02 pm
I'm rather new to PHP, here is the PHP code :
and my HTML code :
Why doesn't it work?
Connection to database = OK.
Code: Select all
// We willen de ID van de pagina kennen.
if (isset($_GET['pid'])) {
$pageid = preg_replace('/[^a-zA-Z0-9\_]/', '', $_GET['pid']); // delete chars NOT in that set
} else {
$pageid = 'page1';
}
// We hebben de benodigde files nodig.
include('../../functions.php');
include('../../functions_willem.php');
// Naam user
$localuser = getcurrentuser(realpath('.'));
// We openen de verbinding met de database.
$db = opendatabase();
opendatabase();
// Update als nodig is.
if (isset($_POST['content_a'])) {
$content_a = $_POST['content_a'];
$sqlquery =("UPDATE SET tblContent (content_a) VALUES ('$content_a') WHERE page='$pageid' AND username='$localuser' ");
$results = mysql_query($sqlquery);
}
else { };Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Update</title>
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<br />
<br />
<textarea id="content_a" name="content_a" rows="15" cols="80"></textarea>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
</body>
</html>Connection to database = OK.