Welcome Guest, Not a member yet? Register   Sign In
Translate database

Hi fellas,

I have found this code to show database error messages:
$data = array('name' => 'John', 'email' => '[email protected]');
$str = $this->db->insert_string('customers', $data);

// returns null if SQL error occurs.
$res = $this->db->query($str);

if (!$res) {
  // if query returns null
  $msg = $this->db->_error_message();
  $num = $this->db->_error_number();

  $data['msg'] = "Error(".$num.") ".$msg;

It is working perfectly but its showing the error in English, is there a way to translate this message?

Thanks in advance.

Use CI Language Class!


Hi Insite

The Language Class do not have the string for all errors

For instance, the error for duplicate ID.

Is it possible to translate those messages without the language class?

Check the language files in system/language/en/db_lang.php


Theme © iAndrew 2016 - Forum software by © MyBB