I'm very new to all this so I don't know much. just have a couple questions. I am trying to make it so that when I click submit on my webpage form (http://www.unlikerabi.com/instructor/signup.html), that the information is passed to the mysql server and put into a table.
Moving on to the questions:
Because practice.php is called every time someone clicks the submit button, does that mean that mysql will try to create a new table every time? If it does, how do i implement practice.php so it only creates the table once?
Is it possible for anyone to see my PHP?
Here's the relevant HTML:
Code:
<h1>Where would you like to find a swim instructor?</h1>
<form name="sample" id="sample" action="php/practice.php"
method="post">
and the practice.php:
Code:
// connect
$con = mysql_connect("localhost","###","###");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Create table
mysql_select_db("###", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// Execute query
mysql_query($sql,$con);
mysql_close($con);
Thanks
Bookmarks