また、データベースに、nullに設定されていない日付データ型の日付フィールドがあります
これが私の見解です-ここに何か追加する必要がありますか?
foreach($blogs AS $viewData)
{
$id = $viewData->id;
$title = $viewData->title;
$body = $viewData->body;
$username = $viewData->username;
$date = $viewData->date;
?>
<b> <?=$title?></b>
<p><?=$body?></p>
<p>posted by:<?=$username?></p>
<p>date: <?=$date?></p>
<hr>
これが私のモデルの関数で、データベースに挿入します...
public function insert_entry()
{
$this->title = $this->input->post('title');
$this->body = $this->input->post('text');
$this->username = $this->session->userdata('username');
$this->date = time();// is there something I should change here?
$this->db->insert('blogs', $this);
}