//here is my function block
public function create_accnt()
{
$post = $this->input->post(); //gets all possible posts in array form
echo "Post array: ";print_r($post); // just to make sure that my array has values
$data = array(
'userid' => $post['user_id'],
'lastname' => $post['lname'],
'firstname' => $post['fname'],
'username' => $post['username'],
'password' => $post['password'],
'usertype' => $post['user_type'],
'status' => 'A'
); // assigning my values to their specific fields where they will be inserted
$query = $this->db->insert('accounts', $data); //insertion via active record
echo "<br/>Result of db last query: ";
echo $this->db->last_query();//to see how my query looks in code form
if($query)
{
return true;
}
else
return false;
// end if
} // end function
//here is the result of the code above
//Post array: Array ( [user_id] => 123456 [lname] => Smith [fname] => John [username] => John [password] => password [c_password] => password [user_type] => S [btn_create] => Create )
//Result of db last query: INSERT INTO accounts (userid, lastname, firstname, username, password, usertype, status) VALUES ('', '', '', '', '', '', '')
这里为什么在查询后我的 VALUES 都是空格?顺便说一句,我正在使用 CodeIgniter,我的数据库驱动程序是 PDO,我的数据库是 DBFoxPro。