Jump to content

ggrrr driving me mad lol


gotornot

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/189194-ggrrr-driving-me-mad-lol/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.