<?php
class login extends Controller {
function login()
{
parent::Controller ();
session_start();
}
function index()
{
$this->load->view ( 'login' );
}
//验证用户名和密码是否合法,如果合法,则跳转至manage页,否则便什么也不执行
function adminLogin()
{
$adminName = $_POST ["adminName"];
$adminPassword = $_POST ["adminPassword"];
$sql = "select * from testTable where name='" . $adminName . "' and pass='" . $adminPassword . "'";
$data = array ();
$data = $this->db->query($sql);
if ($data->num_rows () > 0)
{
$row = $data->row_array ();
$data ["adminName"] = $row ['AdminName'];
$data ["adminPassword"] = $row ['AdminPassword'];
$this->load->view ( 'welcome_message' );
}
else
{
$this->load->view ( 'login' );
}
}
}
?>
到底是什么问题?
总提示
Fatal error: Call to a member function query() on a non-object in D:\AppServ\www\CodeIgniter_1.7.2\system\application\controllers\login.php on line 20 |