Example #1
0
 function addRow($array)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $fdbvar = "__fdb_" . $this->__readserver;
     if (!$this->isLocalhost()) {
         print "Major Error\n";
         exit;
     }
     $string = $this->createQueryStringAdd($array);
     $insert = "insert into {$this->__sqtable} {$string} ;";
     //dprint($insert, 2);
     if ($ins = $this->database_query($gbl->{$fdbvar}, $insert)) {
         dprint("Record inserted in {$this->__sqtable} for {$array['nname']}\n", 1);
         //log_message("insert into {$this->__sqtable}:{$array['nname']} :::: $insert");
     } else {
         log_database("DbError: Insert Failed for {$this->__sqtable}:{$array['nname']}");
         log_bdatabase("DbError: Insert Failed for {$this->__sqtable}:{$array['nname']} {$insert}");
         // Not imporant... I think.. This happens mostly when they try add something twice. Let us just ignore the second time, but log it properly.
         if ($sgbl->dbg > 0) {
             //throw new lxException("db_add_failed", "{$this->__sqtable}:{$array['nname']}");
         }
         return true;
     }
 }
Example #2
0
 function addRow($array)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $fdbvar = "__fdb_" . $this->__readserver;
     if (!$this->isLocalhost()) {
         print "Major error occured! This is not localhost?\n";
         exit;
     }
     $string = $this->createQueryStringAdd($array);
     $insert = "INSERT INTO {$this->__sqtable} {$string} ;";
     if ($ins = $this->database_query($gbl->{$fdbvar}, $insert)) {
         dprint("DB-Record: Inserted in {$this->__sqtable} for {$array['nname']}\n", 1);
     } else {
         log_database("DB-Error: Insert Failed for {$this->__sqtable}:{$array['nname']}");
         log_bdatabase("DB-Error: Insert Failed for {$this->__sqtable}:{$array['nname']} {$insert}");
         return true;
     }
     return false;
 }