Welcome Guest, Not a member yet? Register   Sign In
How to return database errors ?
#3

[eluser]bhenbe[/eluser]
Thank you ;-)

I tried this function but it does'nt work.

Here's the response with db debug on :

Quote:Error Number: 1054

Unknown column 'userbyservicez_serviceid' in 'field list'

INSERT INTO tbluserbyservice(userbyservicez_serviceid, userbyservice_userid, userbyservice_role) VALUES ('1', '2', 1)

(i used a syntax error to test...)

When i set debug off, i have no response with

Code:
function service_add_user($service_id) {
    
   $this->load->library('form_validation');

   if ($this->form_validation->run('service_user_add') == FALSE)
      return array('message_type' => 'error-msg',
         'message_title' => 'Ajout d\'utilisateur à un service',
         'message_content' => validation_errors());
        
   if ($this->service_model->service_add_user($service_id, $_POST['user_id']) === FALSE)
      return array('message_type' => 'error-msg',
         'message_title' => 'Ajout d\'utilisateur à un service',
         'message_content' => $this->db->_error_message());

   return array('message_type' => 'valid-msg',
      'message_title' => 'Ajout d\'utilisateur à un service',
      'message_content' => 'L\'utilisateur a été ajouté');
    
}


Messages In This Thread
How to return database errors ? - by El Forum - 10-07-2009, 06:54 AM
How to return database errors ? - by El Forum - 10-07-2009, 07:20 AM
How to return database errors ? - by El Forum - 10-07-2009, 07:37 AM
How to return database errors ? - by El Forum - 10-07-2009, 07:55 AM
How to return database errors ? - by El Forum - 10-07-2009, 08:07 AM
How to return database errors ? - by El Forum - 10-07-2009, 08:10 AM
How to return database errors ? - by El Forum - 10-07-2009, 08:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB