I need some help! Please...
database: test
table: typetypes
table columns:
1) type_id (primary key, auto-increment)
2) typetype (char)
I just want a simple code to input a word, then refresh the page allowing me to insert another word... I know I am missing some part of this, but don't know enough to be able to figure it out... can someone PLEASE give me some help?
Also, how do I get this code to be all colored?
<html>
<body>
<?php
//***connection to MYSQL*
$dbcnx = @mysql_connect("localhost", "root", "mypassword");
if (!$dbcnx) {
echo( "<p>Unable to connect to the " .
"database server at this time.</p>" );
exit();
}
//connection to the TEST database********
mysql_select_db("test", $dbcnx);
if (! @mysql_select_db("test") ) {
echo( "<p>Unable to locate the test" .
"database at this time.</p>" );
exit();
}
?>
<form action="<?=$PHP_SELF?>" method="post">
<p>Enter Type:<br />
<input type="text" name="typetype"><br />
<input type="submit" name="submittype" value="SUBMIT" />
</p>
</form>
<?php
if ($submittype == "SUBMIT") {
$sql = "INSERT INTO typetypes SET
type_id='1',
typetype='$typetype'";
}
$result = mysql_query($sql);
?>
</body>
</html>