CodeIgniter Forums

Full Version: Adding error!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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',