【发布时间】:2014-01-26 05:01:40
【问题描述】:
我的数据库遇到了这个错误,说我的数组有问题:
数据库错误
错误:SQLSTATE[42S22]:未找到列:1054 '字段列表'中的未知列'数组'
SQL 查询:UPDATE `mongexc_cake214`.`configurations` SET `id` = 1, `username` = 'bill clinton', `profession` = 'president', `description` = 'Ob Jones-D is a Thai按摩和电子针灸专家。 Lorem ipsum dolor sit amet, consectetur adipisicing elit。 Quam, repellat optio officiis neque ea repudiandae sint corrupti illo? Maiores adipisci mollitia quae perferendis numquam minima deserunt ratione placeat rem。 Numquam?', `tel_mobile` = '000-000-0000', `address` = '000 new york of africa V99 999', `userphoto` = Array WHERE `mongexc_cake214`.`configurations`.`id` = '1 '
注意:如果要自定义此错误信息,请创建 app/View/Errors/pdo_error.ctp
这是我的 edit.php 文件的一部分,其中包含用于上传图片文件的字段 userphoto
<?php echo $this->Form->create('Configuration', array('type' => 'file')); ?>
<fieldset>
<legend><?php echo __('Edit Configuration'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('username');
echo $this->Form->input('profession');
echo $this->Form->input('description', array('type' => 'textarea','label' => 'Content of this Article', 'rows' => '10', 'cols' => '120'));
echo $this->Form->input('userphoto', array('type' => 'file'));
echo $this->Form->input('tel_mobile');
echo $this->Form->input('address');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit')); ?>
【问题讨论】:
-
你是如何在你的相关控制器中处理传入的
userphoto文件数组信息的? -
谢谢!这是我的要点link。我在'edit.ctp'
标签: php cakephp file-upload cakephp-2.0