Below is the code in my model, I'm using Codeigniter, I'm sure there's a simple problem with it but I've been trying for a long time, any ideas?
<?php
class Users_model extends CI_Model {
public function __construct() {
parent::__construct();
$this->load->database();
}
public function checkLogin($username, $pass) {
$sql = "SELECT COUNT(*) FROM Users WHERE username=? AND password=?;";
$query = $this->db->query($sql, $username, sha1($pass));
if ($query -> num_rows() == 1) {
return True;
} else {
return False;
}
}
}
?>
Error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND password=?' at line 1
SELECT COUNT(*) FROM Users WHERE username=? AND password=?;?