I am trying to insert all extra questions asked on data cpture into a db will this work
if (isset($REQUEST))
{
foreach($REQUEST as $key=>$value)
{
// only get the data for extra questions
$schq = "SELECT * FROM extraq WHERE programid='$programid'";
$schr = mysql_query($schq);
while($schrow=mysql_fetch_array($schr))
{
$thisqid = $schrow["id"];
if ($thisqid=='$key')
{
$addq3 = "INSERT INTO $extraqopt (extraqid, value, subid) VALUES ('$thisqid', '$value', '$subid')";
$addr3 = mysql_query($addq3);
}
}
}
}