Welcome Guest, Not a member yet? Register   Sign In
[Solved] When Insert New User Get 2 preg_match() errors
#2

[eluser]riwakawd[/eluser]
Please note: I worked it out I had to make some changes. Here below is what have changed.

Now just have to find away to make new user have own user id.

Code:
public function insert_user() {

    $this->db->where('username', $this->input->post('username'));
  $query  = $this->db->get('users');

  if ($query->num_rows > 0) {
   echo '<div class="alert alert-error"><a class="close" data-dismiss="alert">×</a><strong>';
   echo "Username already taken";
   echo '</strong></div>';
  } else {

   $this->load->library('bcrypt');

   $sql = array(
      'firstname' => $this->input->post('firstname'),
      'ip' => $this->session->userdata('ip_address'),
      'lastname' => $this->input->post('lastname'),
      'email' => $this->input->post('email'),
      'country' => $this->input->post('country'),
      'username' => $this->input->post('username'),
    
   );

   $result = $this->db->insert('users', $sql);
   return $result;
  }

   }


Messages In This Thread
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 06:02 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 08:02 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 11:40 PM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-28-2014, 11:52 PM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 12:09 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 12:16 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 01:27 AM
[Solved] When Insert New User Get 2 preg_match() errors - by El Forum - 04-29-2014, 07:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB