我已经使用代码几个小时了,只是看不到哪里出错了。这是有问题的代码
$answercreatequery = pg_query("INSERT INTO answer (answerid, questionid, adescription, afilelocation, iscorrect) VALUES( default, '".$thisquestionid."', '".$adescription1."', '".$afilelocation."', '".$iscorrect1."' ");
这是报告的错误
警告:pg_query() [function.pg-query]:查询失败:错误:输入第 1 行末尾的语法错误:...on,是正确的)值(默认值,'37','kyfhdkj','none', '' ^ 在 /ceri/homes1/m/mtp4/public_html/mmp/Quizmaker/Clientside/questioncreatescript.php 第 167 行
我想知道我是否缺少一些简单的东西?我怀疑这是因为 $iscorrect1 是布尔类型,我尝试以多种方式对其进行编辑,但仍然出现同样的错误。
/d 答案表
Column | Type | Modifiers
---------------+------------------------+-----------------------------------------------------------
answerid | integer | not null default nextval('answer_answerid_seq'::regclass)
questionid | integer | not null
adescription | character varying(200) | not null
afilelocation | character varying(200) | not null
iscorrect | boolean | not null
Indexes:
"answer_pkey" PRIMARY KEY, btree (answerid)
Foreign-key constraints:
"answer_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question(questionid)