943,754 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 332
  • PHP RSS
Dec 12th, 2008
0

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

Expand Post »
lines of code is:

php Syntax (Toggle Plain Text)
  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 :

sql Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mm2409 is offline Offline
6 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: download, install & redirect
Next Thread in PHP Forum Timeline: Some1 who know how can I put PTC site info into a banner???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC