0

とのデータベースに接続するために with を使用してCodeigniterいます。Grocery CrudMySQLPhpMyAdmin

チュートリアルにあるようにすべてをインストールしましたが、常にエラーが発生する可能性があります。

私の問題は次のとおりですvarchar (255)。最初の2つと生年月日に使用する単純なテーブル(名前用、姓用、生年月日用の3つのフィールド)DATEがあります。新しいレコードを追加するか、既存のレコードを更新すると、ジョブが正常に実行されたと表示されますが、実際には実行されませんでした。そして、DATEフィールドのみ。他の 2 つの列を完全に追加および更新できます。

何か案は?

編集:要求されたとおりにコードを追加しました。これはController、患者を取得する です。

<?php if (!defined('BASEPATH'))
    exit('No direct script access allowed');
class GetPatients extends CI_Controller
{

    function __construct()
    {
        parent::__construct();

        $this->load->database();
        $this->load->helper('url');

        $this->load->library('grocery_CRUD');
    }

    public function index()
    {
        echo "<h1>Welcome to the world of Codeigniter</h1>"; //Just an example to ensure that we get into the function
        die();
    }

    public function dbpatients()
    {
        $this->grocery_crud->set_table('patient');
        $output = $this->grocery_crud->render();

        $this->_example_output($output);
    }

    function _example_output($output = null)
    {
        $this->load->view('patients_view',$output);
    }

}
4

1 に答える 1

1

mysql date col は、割り当て値として数値または文字列のみをサポートします。日付形式を変換できます

$datestring = "%Y%m%d";
    $time = time();
    $date = mdate($datestring, $time);
于 2013-11-30T12:36:06.470 に答える