80183

新建表问题

回帖
回帖数 1
阅读数 2597
发表时间 2011-06-20 14:58:11
🚖
厦大楼主
呵呵,又来打扰春哥了!
提交表单时,显示"稍候...." 然后就不动了
数据没有写到表里,company字段没有特殊处理,想请教春哥是那里出了问题

代码参考产品里的productplan的相应方法
//model
public function createCustomer($planID)
{
$plan = fixer::input('post')->stripTags('person')->get();
$this->dao->insert(TABLE_CUSTOMER)->data($plan)->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
//control
public function createCustomer($planID = '')
{
if(!empty($_POST))
{
$cID = $this->productplan->createCustomer();
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('action')->create('productplan', $planID, 'opened');
die(js::locate($this->createLink('productplan', 'viewcustomer', "planID=$planID"), 'parent'));
}


$plan = $this->productplan->getByID($planID);
$this->commonAction($plan->product);
$this->view->header->title = $this->lang->productplan->createCustomer;
$this->view->position[] = $this->lang->productplan->createCustomer;
$this->display();

}
--customer表
CREATE TABLE `customer` (
`id` mediumint(8) NOT NULL ,
`company` mediumint(8) NULL ,
`person` char(30) NULL ,
`position` char(16) NULL ,
`gendar` enum('m','f') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'm' ,
`phone` char(11) NULL ,
`tel` char(20) NULL ,
`email` char(90) NULL ,
PRIMARY KEY (`id`),
INDEX `company` (`company`) USING BTREE
)
ENGINE=MyISAM
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=3
CHECKSUM=0
ROW_FORMAT=DYNAMIC
DELAY_KEY_WRITE=0
;
2011-06-20 15:03:23 厦大 最后编辑
1个回复
🚖
厦大沙发

问题已经解决,多谢春哥的,热情帮助。

2011-07-11 16:06:52 厦大 回帖
联系我们
联系人
魏中显/高级客户经理
电话(微信)
18561939726
QQ号码
1746749398
联系邮箱
weizhongxian@chandao.com
相关帖子
返回顶部
客服头像
魏中显
高级客户经理
客服微信
18561939726
1746749398
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。问题反馈反馈点击这里,让我们聆听您的建议与反馈。