I am having problems inserting more than one value into my database.I am using psql and somehow the variables are overwritten and it only inserts the last value in the form.
This is my code so far
for($i=0; $i<$numStudents; $i++)
{
$result = "INSERT INTO student_work(login_id,mark_received,work_name,section,term,cid)VALUES('$login_id',$mark_received,'$work_name',$section,'$term','$cid')";
pg_exec($database,$result);
echo unset($login_id);
echo unset($mark_received);
//print database after insertion
$result=pg_exec($database,"select * from student_work");
for($i=0;$i<pg_NumRows($result);$i++)
{
print pg_Result($result,$i,0);
print pg_Result($result,$i,1);
print pg_Result($result,$i,2);
print pg_Result($result,$i,3);
print pg_Result($result,$i,4);
print pg_Result($result,$i,5)."<BR>\n";
}
}//end of first for loop
Can you help me please!!!!!