So i'm totally new at this. I have a field in my form that asks the user what Grade he or she is in but i don understand how to pass that answer into my database. Can anyone help? <form action="insert.php" method="POST"> <select name="Class" id="Class" onchange="MM_jumpMenu('parent',this,0)"> <option>Select</option> <option>Freshman</option> <option>Sophomore</option> <option>Junior</option> <option>Senior</option> <option>item1</option> </select> </form> Code (markup):
What is the code in insert.php? If it has the code to connect to the database and insert/update the table, you are done.
insert.php should contain something like this: mysql_connect(localhost,'username','paassword'); @mysql_select_db('dbname') or die( "Unable to select database"); PHP: get the values form the form: $class = $_POST['Class'] PHP: insert into db: mysql_query("INSERT INTO students (class) VALUES ($class)"); PHP: