【发布时间】:2014-11-26 09:50:17
【问题描述】:
所以,我遇到了一个小问题,我不知道出了什么问题。我有一些数据需要添加到表单和数据库中。我创建了数据库字段,使用varchar 数据类型将其命名为“visit_nature”,然后继续创建表单字段。
<div class="controls-row" id="visitNature">
<div class="span2">
<?php echo $this->Form->label('visit_nature', 'Symptomatic or Asymptomatic', array('class'=>'required')); ?>
</div>
<div class="span10">
<?php
echo $this->Form->input('visit_nature', array(
'options' => array('Symptomatic' => 'Symptomatic',
'Asymptomatic' => 'Asymptomatic'),
'empty' => '--Select Vist Nature--',
'class'=>'validate[required]',
));
?>
<span class="help-inline">Does the patient have symptoms or not</span>
</div>
</div>
现在,有趣的是,当您检查网络请求时,来自那里的数据是可见的,但它从未进入数据库,表单上的其他字段已发布。 这些都显示了
_method:"POST",data[PatientVisit][patient_id]:"784"data[PatientVisit][visit_nature]:"Symptomatic"
为什么不将数据发送到数据库?!
【问题讨论】:
-
回显您的 SQL 查询。所有数据都存在吗?
-
谢谢@Abhishek 我不知何故忘记了我必须清除 tmp 文件夹中的缓存。终于成功了。