gotornot Posted January 20, 2010 Share Posted January 20, 2010 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 More sharing options...
jamesxg1 Posted January 20, 2010 Share Posted January 20, 2010 Do you get any errors ?. What do you want it to do ?. What have you already tried ?. Please use CODE BOXES . James. Link to comment https://forums.phpfreaks.com/topic/189194-ggrrr-driving-me-mad-lol/#findComment-998872 Share on other sites More sharing options...
ignace Posted January 20, 2010 Share Posted January 20, 2010 Don't create 2 topics for the same thing: http://www.phpfreaks.com/forums/index.php/topic,284875.msg1351159.html#msg1351159 Link to comment https://forums.phpfreaks.com/topic/189194-ggrrr-driving-me-mad-lol/#findComment-998947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.