I currently have a simple input form page with a submit button. I would like to have that submit button write data into my mysql databased based on one of the 2 selections the user has.
For example, 2 of the selections are: X and Y. If a user has selected the X option, I would like to have all the text/form inputs written/inserted into the X table of my database instead of the Y, and vice versa.
I'm relatively new to web development so any advice would be immensely helpful as this is a small project I'm helping develop for my workplace.
<!--option buttons--> <div class="row text-center"> <div class="col-lg-4"> <span class="fa-stack fa-3x"> <i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-plus fa-stack-1x fa-inverse"></i> </span> </div> <!--first X selection button here--> <div class="col-lg-4"> <span class="fa-stack fa-3x"> <i class="fa fa-circle fa-stack-2x text-reading"></i> <i class="fa fa-book fa-stack-1x fa-inverse fa-custominverse"></i> </span> </div> </div> <!--second Y selection button here-->
<?php require('db_connect.php'); require('auth.php'); $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $homework = $_POST['Xselection']; $classwork = $_POST['Yselection']; $sql = "INSERT INTO "" .... ?>
Edit: here is the full code
my question is- how do i make it so that the 2 options for "math" and "reading" are buttons/ selection which would correspond to writing into their separate respective tables in my database?