Can anyone help me on this one? I am trying to write an update query that updates many rows from a form element array.
for($i = 0; $i <= $GET[numrows] ; $i++)
{
$sql = " UPDATE [LOW_PRIORITY] pupil_details SET $GET[dept_data_col]='$POST[textbox][$i]' WHERE Adm_No='$POST[id][$i]' ";
$result = @($sql ,connection)
or die("Couldn't execute query.");
}
I have tested all the $POST and $GET variables to make sure they have been passed properly to this script. They can all be printed, but do not seem to work in the query.
// $sql = " UPDATE pupil_details SET Maths_YR8_NCL='6' WHERE Adm_No='4230' ";
The above query is 1 example of what I am trying to achieve. I have also tried quotes in a million different ways but to no avail.
Thanks in advance.
Ryan