I'm having a heck of a time writing to a simple database.
heres what i've done so far
practice form:
<form method="post" action="formstest.php">
first name:<br>
<input type=text name="name"><br>
last:<br>
<input type=text name="last"><br>
memo:
<input type=memo name="memo"><br>
<input type=submit name=submit value=submit>
</form>
and here is the php script:
<?
if ((!$name) || (!$last) || (!$memo)){
header("location: http://localhost/forms.htm");
exit;
}
$db_name = "formsDB";
$table_name = "one";
$connection = @mysql_connect("localhost", "matt", "sword") or die("couldn't connect");
$db = @mysql_select_db($db_name, $connection) or die ("coudnt select database");
$sql = "INSERT INTO $table_name (name,last,memo) VALUES(\"$name\", \"$last\",\"$memo\")";
$result = @($sql,$connection) or die("couldnt execute");
?>
I can connect, but it's not executing. Can any one help.
matt