Codeigniter-Frontend-Language-Files-Editor icon indicating copy to clipboard operation
Codeigniter-Frontend-Language-Files-Editor copied to clipboard

Postgresql Error

Open zedzedtop opened this issue 12 years ago • 1 comments

there are some errors for postresql backend.

Database création for Postgre

CREATE TABLE language_keys
(
  "key" character varying(255) NOT NULL,
  filename character varying(255) NOT NULL,
  "comment" character varying(255),
  CONSTRAINT pk_language_keys_key_filename PRIMARY KEY (key, filename)
 );

You should use primary key in your database.

Sql syntaxe error in models/model_language.php

--- model_language.php.old      2012-03-30 21:03:05.000000000 +0400
+++ model_language.php  2012-03-30 21:03:14.000000000 +0400
@@ -100,7 +100,7 @@
         * @return      array
         */
        function get_keys_from_db($file){
-               $this->db->select('key as `keys`');
+               $this->db->select('key as keys');
                $r = $this->db->get_where('language_keys', array('filename' => $file));
                if($r->num_rows()){
                        $result=$r->result();
@@ -118,7 +118,7 @@
         * @return      array
         */
        function get_comments_from_db($file){
-               $this->db->select('key as `keys`,comment');
+               $this->db->select('key as keys,comment');
                $r = $this->db->get_where('language_keys', array('filename' => $file));
                if($r->num_rows()){
                        $result=$r->result();

why you use an alias ??

zedzedtop avatar Mar 30 '12 17:03 zedzedtop

Thanks for this, I will apply this changes this weekend. :o) I don't really remember why there is an alias (I'm trying to avoid that, if it's not necessary). probably my old SQL client didn't like "key"

kokers avatar Apr 06 '12 16:04 kokers