я хочу решить эту проблему, но я не могу .. пожалуйста, дайте мне предложение - PullRequest
0 голосов
/ 29 марта 2019
Error Number: 1146
Table 'blood_donor.admmin' doesn't exist
SELECT * FROM `login`, `Admmin` WHERE `Username` = 'Admmin' AND `Password` = '81dc9bdb52d04dc20036dbd8313ed055' LIMIT 1234
Filename: C:/wamp64/www/ci_donor/system/database/DB_driver.php
Line Number: 6

Мой контроллер:

defined('BASEPATH') or exit('No direct script access allowed');

class Admin extends CI_Controller {
    function __construct() {
        parent::__construct();
        $this
            ->load
            ->model('Admin_model', 'qmodel');
    }

    public function index() {
        $this
            ->load
            ->view('Login');
    }

    public function admin_login() {
        $Username = $this
            ->input
            ->post('Username', true);

        $Password = $this
            ->input
            ->post('Password', true);
        $this
            ->load
            ->model('Admin_model');

        $this
            ->Admin_model
            ->admin_login_info($Username, $Password);

        $result = $this
            ->Admin_model->$query_result;

        if ($result) {
            redirect();
        } else  {
            echo "your username or password is invalid";
        }
    }
}

Моя модель:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Admin_model extends CI_Model {
    public function admin_login_info($Username,$Password) {
        $this->db->select('*');
        $this->db->from('login');
        $this->db->where('Username',$Username);
        $this->db->where('Password',md5($Password));
        $query_result=$this->db->get($Username,$Password);
        $result=$query_result->row();
        return $result;
    }
}
...