0

After successfully registration the following error appears:

A PHP Error was encountered

Severity: Notice

Message: Undefined index: password

Filename: models/user_model.php

Line Number: 32

Code:

 function insert_data($data)
   { 

    $data_user=array(
      'email'=> $data['email'],
      'password'=> md5($data['password']),
      'status'=>'0'
      );   
     return $this->db->insert('users', $data_user); 

   }
Sanjuktha
  • 1,065
  • 3
  • 13
  • 26

1 Answers1

0

Make sure the array of $data has 'password' data. You can check it by debuging with this script die($data['password']); so like this.

function insert_data($data)
   { 
die($data['password']);
    $data_user=array(
      'email'=> $data['email'],
      'password'=> md5($data['password']),
      'status'=>'0'
      );   
     return $this->db->insert('users', $data_user); 

   }

hopefully this can help you ;)