<?php
$schoolID = $_COOKIE['status'];
$query = "SELECT teacherSubject.*,subjects.*
FROM teacherSubject,subjects
WHERE teacherSubject.subjectID = subjects.subjectID
AND schoolID = '$schoolID'";
include("dbInfo.php");
$result = mysql_query($query) or die(mysql_error());//obtain data for <select>
$subjectID = $_POST['subjects'];
$groupName = $_POST['groupName'];
$createQuery = "INSERT INTO groups
(groupID,subjectID,schoolID,groupName)
VALUES
('','$subjectID','$schoolID','$groupName')";
if($_POST['groupName'] != NULL)//insert data on submission
{
$createResult = mysql_query($createQuery) or die(mysql_error());
echo("New Group Created");
}
?>
thats my php code there where i did the query for my <select> because the values are taken from the data base and the second query is for storing the data the user has chosen but my problem is that when the user submits and i check it on the database no data is stored on the table groups i hope you guys can help me out on this one thanks