Q:

codeigniter - error in my program

i'm following the tutorial on this url:
http://www.codefactorycr.com/login-with-codeigniter-php.html
I'm trying to made some modification to the tutorial:
a login form with 3 input box (company name, username, password)
Below i encounter problem with verifylogin.php
Any guidance is greatly appreciated, thanks.
<?php   if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class VerifyLogin extends CI_Controller
{
public function __construct()
{   parent::__construct();
}

public function index()
{
    $config_login = array(
            array(
             'field'   => 'company',
             'label'   => 'Company',
             'rules'   => 'trim|required|min_length[1]|max_length[50]|strip_tags|encode_php_tags|htmlspecialchars|xss_clean'
            ),
            array(
             'field'   => 'username',
             'label'   => 'Username',
             'rules'   => 'trim|required|min_length[1]|max_length[50]|strip_tags|encode_php_tags|htmlspecialchars|xss_clean'
            ),
            array(
             'field'   => 'password',
             'label'   => 'Password',
             'rules'   => 'required|xss_clean|callback__check_database'
            )
    );

    $this -> form_validation -> set_rules($config_login);

yes. problem solved aafter i change the $config to $config_login.
Many thanks for your guidance.

A:

change all the where conditions to like this,
$this->db->where('company',$company);
$this->db->where('username',$username);
$this->db->where('password',$password);

As you are passing these variables to your model function login.
 and change your login as 
function login($company, $username, $password){

Hope this helps
Regards
iijb

