query executes and return correct value but cudnt save one value into db

Reply

Join Date: Dec 2008
Posts: 6
Reputation: mm2409 is an unknown quantity at this point 
Solved Threads: 0
mm2409 mm2409 is offline Offline
Newbie Poster

query executes and return correct value but cudnt save one value into db

 
0
  #1
Dec 12th, 2008
lines of code is:

  1. $que_id = uniqid();
  2. $que['Yes'] = No;
  3. $que['No'] = No;
  4. $que[$_POST['r1']] = Yes;
  5.  
  6. $que_words1= $_POST['q1'];
  7. $sql = "INSERT INTO `tbl_CT_Questions` (`Question_ID`,`Questionnaire_ID`,`Question_Words`,`Answer_Type`)
  8. VALUES (0,'".$que_id."','".$que_words1."','".$que[$_POST['r1']]."')";
  9.  
  10. $result = mysql_query($sql) or die(mysql_error()) ;
  11. echo mysql_error();
  12. echo $sql;
  13. echo "<br>";


whr query returns :

  1. INSERT INTO `tbl_CT_Questions` (`Question_ID`,`Questionnaire_ID`,`Question_Words`,`Answer_Type`) VALUES (0,'494220e779547','Conflicts Questionnaire','Yes')

as u see 'Answer_Type' in query returns value 'Yes' but i cudnt see it into table...whr into databse 'Answer_Type' has datatype 'enum'
Last edited by peter_budo; Dec 12th, 2008 at 6:54 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC