Hi,
I have two tables user and courses.. m trying to insert the data in the table of courses which containing forign key of user table.. as i have checked the syntax but m not able to solve my problem.. Here is the code...

<?php 
print_r($_REQUEST);


echo $UserID= $_POST['userID'];
echo $Name= $_POST['Name'];
echo $Description= $_POST['Description'];
echo $Category =$_POST['Category'];
echo $Notes = $_POST['Notes'];


mysql_connect("localhost", "root" , "") or die ('Error:' . mysql_error());
mysql_select_db("student_registration");
?>

<?php


echo $query= "INSERT INTO course(UserID, Name, Description, Category, Notes) VALUES ('".$UserID."' , '".$Name."', '".$Description."', '".$Category."', '".$Notes."')";

mysql_query($query) or die ('Error Inserting Data');

?>

What is the error message?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.