in the form,i hav 4 variables,if u need me to post this,i can.
name,id,course,grade
this is my php page so far:
Code: Select all
//gets all the vars to us
$name = $_REQUEST['name'];
$id = $_REQUEST['id'];
$course = $_REQUEST['course'];
$grade = $_REQUEST['grade'];
$sql = 'INSERT INTO `teacher` (`Name`, `Course_id`, `Course_name`, `Grade`) VALUES ('$name', '$id', '$course', '$grade')';
include "../include/teachers.inc";//includes my db connections
//puts everything into the DB
$result = mysql_query ($sql) or die('Query failed: ' . mysql_error());
$affect = mysql_affected_rows();*/
//when i tried to echo the vars,nothing came up,this is wat i tried
print "$name";
echo ($id);
echo ($course);
echo ($grade);