I created a table person
with two tinytint fields to decide the role of a person. The roles are instructor
and faculty
. A person can be one or both. I preferred to use tinyint since I can possibly set 1
to true and 0
to false. The question is how can I do so and submit the values into mysql table person
. SITE
The table
CREATE TABLE IF NOT EXISTS `person` (
`person_id` int(11) NOT NULL auto_increment,
`faculty_role` tinyint(1) NOT NULL,
`instructor_role` tinyint(1) NOT NULL,
`person_name` varchar(50) NOT NULL,
PRIMARY KEY (`person_id`),
);
HTML
<?php
if(isset($_POST['submit'])){
//Need help here
}
?>
<form action="test2.php" method="POST">
<b>Select the role for the person</b>
</br>
</br>
Name:<input type="text" name="person_name">
<input type="checkbox" name="role" value="faculty">faculty
<input type="checkbox" name="role" value="instructor">instructor<br><br>
Name:<input type="text" name="person_name">
<input type="checkbox" name="role" value="faculty">faculty
<input type="checkbox" name="role" value="instructor">instructor<br><br>
<input value="SAVE" name="submit" type="submit">
</form>