From a5dea630a9ce699aa6e6ba9b964bd26e5c51fbfc Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 6 Feb 2012 17:36:11 -0500 Subject: [PATCH] remove duplicate class --- src/databases/db_pdo.php | 146 --------------------------------------- 1 file changed, 146 deletions(-) delete mode 100644 src/databases/db_pdo.php diff --git a/src/databases/db_pdo.php b/src/databases/db_pdo.php deleted file mode 100644 index 816f1f7..0000000 --- a/src/databases/db_pdo.php +++ /dev/null @@ -1,146 +0,0 @@ -prepare($sql); - - if( ! is_like_array($query)) - { - $this->get_last_error(); - return FALSE; - } - - // Set the statement in the class variable for easy later access - $this->statement =& $query; - - - if( ! is_like_array($data)) - { - trigger_error("Invalid data argument"); - return FALSE; - } - - // Bind the parameters - foreach($data as $k => $value) - { - $res = $query->bindValue($k, $value); - - if( ! $res) - { - trigger_error("Parameter not successfully bound"); - return FALSE; - } - } - - return $query; - - } - - // ------------------------------------------------------------------------- - - /** - * Retreives the data from a select query - * - * @param PDOStatement $statement - * @return array - */ - function get_query_data($statement) - { - // Execute the query - $statement->execute(); - - // Return the data array fetched - return $statement->fetchAll(PDO::FETCH_ASSOC); - } - - // ------------------------------------------------------------------------- - - /** - * Returns number of rows affected by an INSERT, UPDATE, DELETE type query - * - * @param PDOStatement $statement - * @return int - */ - function affected_rows($statement) - { - // Execute the query - $statement->execute(); - - // Return number of rows affected - return $statement->rowCount(); - } - - // ------------------------------------------------------------------------- - - /** - * Abstract functions to override in child classes - */ - - /** - * Return list of tables for the current database - * - * @return array - */ - abstract function get_tables(); - - /** - * Empty the passed table - * - * @param string $table - * - * @return void - */ - abstract function truncate($table); - - /** - * Return the number of rows for the last SELECT query - * - * @return int - */ - abstract function num_rows(); - - /** - * Return the number of rows affected by the last query - * - * @return int - */ - abstract function affected_rows(); - -} -// End of db_pdo.php \ No newline at end of file