[eluser]Gwarrior[/eluser]
For some reason, I keep getting an error
A Database Error Occurred
Error Number: 1054
Unknown column 'allengingrich' in 'where clause'
SELECT password FROM users WHERE username=allengingrich
Which is a result of trying to use a login form using the following controller:
Code:
function login() {
$this->load->database();
$this->load->library('session');
if (isset($_POST['submitted'])) {
$username = $_POST['username'];
$password = $this->db->query('SELECT password FROM users WHERE username='.$username);
if ($password->result() == $_POST['password']) {
$sessdata = array(
'username' => $_POST['username'],
);
$this->session->set_userdata($sessdata);
redirect('home/success');
} else {
redirect('home/failure');
}
}
$this->load->view('login');
}
Anyone know what gives? I can't figure out what the problem is at all...