我的框架是codeigniter。我開發了一個表單來存儲用戶在數據庫中的輸入。一個輸入用於在輸入框內自動填充日期和時間。但是,當我嘗試將其保存在數據庫中時,日期不會保存。形式的其它值保存在數據庫 這是笨視圖頁自動時間不保存在數據庫中-codeigniter
<?php $attributes = array("name" => "addclients");echo form_open("home/ExpenseSave", $attributes);?>
<div class="row">
<body onload="myFunction()">
<input type="text" id="demo" class="form-control"/>
</div>
<script>
function myFunction() {
$(document).ready(function(){
$('#demo').attr("placeholder", Date());
});
}
</script>
這在數據庫
$data = array(
'demo' => $this->input->post('demo'),
'pt' => $this->input->post('pt'),
'pn' => $this->input->post('pn'),
'task' => $this->input->post('task'),
'employee' => $this->input->post('employee'),
'projectname' => $this->input->post('projectname'),
'ExpenseName' => $this->input->post('ExpenseName'),
'ExpenseAmount' => $this->input->post('ExpenseAmount'),
);
if ($this->db->insert('expenses', $data))
在數據庫中,數據類型爲「演示」保存數據這是笨控制器頁面是約會時間。數據庫爲MySQL
請提供您的問題的完整信息。 – Nere
@AbuHassan我編輯了我的問題 – Dushee