ggrrr driving me mad lol

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

ggrrr driving me mad lol

Post by gotornot »

What i am trying to do is grab unique data from a post or get string (I dont know how hence Request)

The problem is what needs to happen is that when i take the code apart any extra q's need to by identified then slotted into the db.

Grr its driving me up the wall.

here is the code:

//grab the sub id for extra q submission
$chkq4 = "SELECT * FROM submission WHERE email='$email' AND programid='$programid'";
$chkr4 = mysql_query($chkq4);
$chkrow4 = mysql_fetch_array($chkr4);
$subid = $chkrow4["id"];
// insert extraq data
// grab the extra data in from the string i may have to blow it appart and check it has a value
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);
}
}
}
}

can anyone point out where im going wrong and why?

Any help is grately appreciated
Post Reply