Here's my code, for some reason, whether I specify a value for the input id or not, it seems to provide one, because ONLY the if statement is run. Also, when I provide a value for the id (or not), nothing is updated or changed.
<?php
$culture = $_POST["culture"];
if (isset($_POST["id"])) {
$UID = $_POST["id"];
mysql_query("UPDATE culture SET cult_desc='$culture' WHERE cult_id=$UID");
echo $UID . " " . $culture . " If Statement Activated";
}
else {
mysql_query("INSERT INTO culture
VALUES(cult_desc='$culture')");
echo $culture . " Else Statement Activated";
}
?>
Here's the html code:
<form action="addculture.php" method="POST">
<span><input type="text" size="3" name="id" />
<input type="text" name="culture" />
<input type="submit" value="add" /></span>
</form>