I am a pretty novice programmer, I am a designer so please excuse my stupid mistakes. I am attempting to make a form that put info into a data base that can be called upon at a later time. I think I created the form, and part of the database, but it is not working, here is my code, if anyone can help.
This is the forms code:
<
html>
<body>
<form action="
http://www.tsunamiproductions.com/tsunami_db.
php" method="post">
<strong>Episode Name</strong>:
<input type="text" name="name" />
<strong>Episode Number</strong>:
<input type="text" name="number" />
<p><strong>Segment 1 Run Time</strong>:
<input type="text" name="runtime" /></p>
National Spots Name: <input type="text" name="national_spot_name" />
National Spots Run Time: <input type="text" name="national_spot_run_time" />
<br><br>Local Spots Name: <input type="text" name="local_spot_name" />
Local Spots Run Time: <input type="text" name="local_spot_run_time" /></br></br>
<p><strong>Segment 2 Run Time</strong>:
<input type="text" name="2runtime" /></p>
National Spots Name: <input type="text" name="2national_spot_name" />
National Spots Run Time: <input type="text" name="2national_spot_run_time" />
<br><br>Local Spots Name: <input type="text" name="2local_spot_name" />
Local Spots Run Time: <input type="text" name="2local_spot_run_time" /></br></br>
<p><strong>Segment 3 Run Time</strong>:
<input type="text" name="3runtime" /></p>
National Spots Name: <input type="text" name="3national_spot_name" />
National Spots Run Time: <input type="text" name="3national_spot_run_time" />
<br><br>Local Spots Name: <input type="text" name="3local_spot_name" />
Local Spots Run Time: <input type="text" name="3local_spot_run_time" /></br></br>
<p><strong>Segment 4 Run Time</strong>:
<input type="text" name="4runtime" /></p>
National Spots Name: <input type="text" name="4national_spot_name" />
National Spots Run Time: <input type="text" name="4national_spot_run_time" />
<br><br>Local Spots Name: <input type="text" name="4local_spot_name" />
Local Spots Run Time: <input type="text" name="4local_spot_run_time" /></br></br>
<p><strong>Segment 5 Run Time</strong>:
<input type="text" name="5runtime" /></p>
<p><strong>Total Run Time</strong>:
<input type="text" name="total_runtime" /></p>
<input type="submit" />
</form>
</body>
</
html>
and here is the database code for a database called tsunami_db.
php
<
html>
<head>
<title>Untitled Document</title>
</head>
<body>
<?
php
$con = mysql_connect("server","user","PW");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE tsunamishows_db",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
// Create table in tsunamishows_db database
mysql_select_db("tsunamishows_db", $con);
$
sql = "CREATE TABLE GirlsGoneFishin
(
runtime varchar(25),
national_spot_name varchar(25),
Age int
)";
mysql_query($
sql,$con);
mysql_close($con);
?>
</body>
</
html>
obviously, i covered up the password and user name and all of that for privacy, but can anyone help me figure out what is wrong with this code???
Thank You for your help.
-Scott