I am trying to create a small shoutbox so I can get this working.
Firstly, I went into PHPMyAdmin and created a database, named "k06". Then, I made a table with two fields. This table was called "shoutbox" (without the "'s). Then I created the two fields, "name" and "comments".
I created a form field, where you can type in the information and it'll send into the database.
[START EXAMPLE]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="insert.php">
<p>Name:
<input name="name" type="text" id="name">
</p>
<p>Comments: <br>
<textarea name="comments" id="comments"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p> </p>
</body>
</html>
[/END EXAMPLE]
Then, I made the insert.php which processed the information.
[START EXAMPLE]
<?
$username="MYUSERNAME";
$password="MYPASSWORD";
$database="k06";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO shoutbox VALUES ('','$name','$comments')";
mysql_query($query);
echo $query;
mysql_close();
?>
[/END EXAMPLE]
When I run submit.php, it displays the form fields and then I type in the information. When I hit submit, it opens up input.php and echos back "INSERT INTO shoutbox VALUES ('','','')" (Without the ""'s once again)
I'm not quite sure what I did wrong... but if someone could point me in the right direction, I'd appreciate it. Thanks.