[eluser]riwakawd[/eluser]
[quote author="CroNiX" date="1403709017"]Looking at the query it should be evident that there are double single quotes around the things you are escaping. escape() adds the quotes, so you don't manually need to.
Code:
username = ''admin''
etc[/quote]
I have fixed Issue. I had to change
"' '" to
" " and now works perfect can login now.
New way working
Code:
$this->db->query("
INSERT INTO
`" . $data['db_prefix'] . "user`
SET
user_id = '1',
user_group_id = '1',
username = " . $this->db->escape($data['username']) .",
salt = ". $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) .",
password = ". $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . ",
`status` = '1',
email = ". $this->db->escape($data['email']) . ",
date_added = NOW()
");
Old way
Code:
$this->db->query("
INSERT INTO
`" . $data['db_prefix'] . "user`
SET
user_id = '1',
user_group_id = '1',
username = '" . $this->db->escape($data['username']) . "',
salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "',
password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "',
`status` = '1',
email = '" . $this->db->escape($data['email']) . "',
date_added = NOW()
");
}