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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.