Help with submitting multiple rows to a table - please
Posted: Wed Nov 24, 2004 6:10 am
Hi folks I am new to this forum, but I guess I may be in and out quiet a bit since I "lost" my php programmer and am having to learn whislt doing.
Can anybody please help with this little problem, I need to add mulitple rows to a DB table. Th form is built (that bit is easy) but when I try to sqlInsert I always get error messages. If someone could "ponit me" in the right direction I would be very happy.
The sqlinsert needs to be on the same page with a simple confirmation message. I can "sort out" which table etc it needs sent to but what I can't do is get multiple variables sent to the sqlInsert.
Here is my table (if it helps)
Can anybody please help with this little problem, I need to add mulitple rows to a DB table. Th form is built (that bit is easy) but when I try to sqlInsert I always get error messages. If someone could "ponit me" in the right direction I would be very happy.
The sqlinsert needs to be on the same page with a simple confirmation message. I can "sort out" which table etc it needs sent to but what I can't do is get multiple variables sent to the sqlInsert.
Here is my table (if it helps)
Code: Select all
echo "<div id='title'>";
echo "Training requests - job skills";
echo "</div>";
echo "<p>";
echo "<form name='trainingrequest' method='get' action='control.php?Employee=$Employee'>";
echo "<div id='col250'>";
echo "Job Skill/s";
echo "</div>";
echo "<div id='col120'>";
echo "Last assessed";
echo "</div>";
echo "<div id='col60'>";
echo "Request";
echo "</div>";
echo "<br>";
$sql = "SELECT * FROM jobtojobskills
LEFT JOIN jobskills ON(jobskills.JobSkillID = jobtojobskills.JobskillID)
LEFT JOIN employeejobskills ON(employeejobskills.JobSkillID=jobtojobskills.JobskillID)
WHERE jobtojobskills.Level>employeejobskills.EmployeeAcceptLevel
AND employeejobskills.EmployeeID='$Employee'
ORDER BY Date DESC";
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs, MYSQL_ASSOC))
{
echo "<div id='col250'>";
echo $row['Skill'];
echo "</div>";
echo "<div id='col120'>";
echo $row['Date'];
echo "</div>";
echo "<div id='col60'>";
echo "<input name=skill[] type='checkbox' value=".$row['JobSkillID'].">";
echo "</div>";
echo "<br>";
}
echo "<input name='request' type='submit'>";
echo "</fom>";