MySQL Forums
Forum List  »  PHP

The Update Syntax
Posted by: Jelmer Vreeman
Date: April 05, 2006 09:15AM

Hi guys,

like the title said, I have a problem with the update syntax.
I have in a database an enum-column called Goedgekeurd with the choice of 'Yes' and 'No'. But I want to write a script so visitors can change this column from 'Yes' to 'No'. I've written this now:

<?php
$user = "******";
$pass = "******";
$host = "sql.netformatie.nl";
$dbdb = "vreeman";

if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}

unset($user);
unset($pass);
unset($host);
unset($dbdb);

$sql = 'UPDATE `bestanden` SET Goedgekeurd=Yes';

$res = mysql_query($sql);

if($_SERVER['REQUEST_METHOD'] == "POST")
{
if(isset($_POST['submit']))
{
echo "Akkoord";
}
}

include "confirmation_akkoord.htm";
?>

It doesn't give an error, but it doesn't update the field from No to Yes either. Please can anyone tell me what I've done wrong?

Greets,
Jelmer

Options: ReplyQuote


Subject
Written By
Posted
The Update Syntax
April 05, 2006 09:15AM
April 05, 2006 09:39AM
April 06, 2006 02:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.