Translate database

Hi fellas,

I have found this code to show database error messages:
$data = array('name' => 'John', 'email' => '');
$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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.