Ejemplo n.º 1
0
 /**
  * Check if $table exists in the selected DB
  * 
  * @param string $table - Table name that exists in the selected db
  * @return boolean
  */
 public static function lookupTable($table, $target = "h2owirelessnow")
 {
     $query = " Select count(*) count From systables \n                    Where tabtype ='T'\n                      And tabname = :table\n                 ";
     $var_arr = compact('table');
     try {
         $db = new PDOConnector($target);
         $ret = $db->selectRecords($query, $var_arr);
         $db->close();
         return $ret[0]['count'] ? true : false;
     } catch (PDOException $e) {
         self::displayError("System error occurred.", "Please go back", $e);
     }
 }
Ejemplo n.º 2
0
 protected function _execute($query, $var_arr)
 {
     try {
         $db = new PDOConnector($this->db);
         $ret = $db->executeQuery($query, $var_arr);
         $this->affectedRowCounts = $db->affectedRowCounts;
         $db->close();
         return $this->affectedRowCounts;
     } catch (PDOException $e) {
         Util::displayError("System error occurred.", "Please go back", $e);
     }
 }