【发布时间】:2013-10-31 15:54:06
【问题描述】:
models.php
<?php defined('SYSPATH') or die('No direct script access.');
class Model_manage_feeds extends ORM {
protected $_table_name = 'User';
public function manage_user(){
$query = DB::select()->from('User');
return $query;
}
}
控制器/user_details.php
public function action_manage_user() {
$this->template->title = "Manage User";
this->template->content = View::factory('manage_user');
}
查看我的数据库结构,
ID 用户名 密码 邮箱 is_active
约翰 xxxxxx john@gmail.com 1
乔治 xxxxxx george@aol.com 1
我想显示表格中的用户名和电子邮件 ID。我正在学习 php 和 kohana,我知道如何从 kohana 教程中插入、编辑和删除,现在我正在尝试显示数据库中的数据。我没有知道该怎么做。
【问题讨论】:
-
你有
Model_User吗? -
@kingkero 是 Model_User 我拥有并粘贴了模型文件。