forked from science-ation/science-ation
Dont do a foreach on a non-array (if no questions were answered)
This commit is contained in:
parent
b63674f649
commit
d56f62f95e
@ -74,6 +74,8 @@ echo mysql_error();
|
||||
{
|
||||
//first we will delete all their old answer, its easier to delete and re-insert in this case then it would be to find the corresponding answers and update them
|
||||
mysql_query("DELETE FROM safety WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
|
||||
if(is_array($_POST['safety']))
|
||||
{
|
||||
$safetyids=array_keys($_POST['safety']);
|
||||
foreach($safetyids AS $key=>$val)
|
||||
{
|
||||
@ -87,6 +89,7 @@ echo mysql_error();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user