I have a conmysql.php with this function:
function addTeacher($idTeach,$nameTeacher,$teacherDay){
$adicionar = sprintf("INSERT INTO `test`.`teacher` (`$idTeacher`, `$nameTeacher`, `$teacherDay`) VALUES ('$idTeacher', '$nameTeacher', '$teacherDay');");
$queryadd = mysql_query($adicionar);
}
I'm filling these variables with 3 forms, and it's working but i don't know how to trigger the addTeacher (); on a HTML button.
I should use AJAX? If yes, how?