我正在使用Codeigniter
withGrocery Crud
连接和中的MySQL
数据库PhpMyAdmin
。
我按照教程所说安装了所有东西,但错误总是存在。
我的问题是:我有一个简单的表(3 个字段,一个用于姓名,另一个用于姓氏,另一个用于出生日期),varchar (255)
用于前两个和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);
}
}