CodeIgniter Forums
Adding error! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Adding error! (/thread-45545.html)



Adding error! - El Forum - 09-26-2011

[eluser]miwrath[/eluser]
all my codes are correct except for the user_reg models:

here is the code:

Code:
<?php
class User_reg extends Model
{

function User_reg()
{
    parent::Model();
  
}

function register_user($username, $password, $password_conf, $f_name, $m_name, $l_name, $teach_id, $position)
{

    
    $query_str = "INSERT INTO accnt_info (username, password, f_name, m_name, l_name, teach_id, position)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    
    $this->db->query($query_str, array($username, $password, $password_conf, $f_name, $m_name, $l_name, $teach_id, $position));
    
}




and this error comes out:



Code:
A Database Error Occurred

Error Number: 1064

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 '' at line 2

INSERT INTO accnt_info (username, password, f_name, m_name, l_name, teach_id, position) VALUES ('mewmew', 'mcc', 'mcc', 'mew', 'mew', 'mew', '2011c000001', 'teacher',