Database class addtions

This commit is contained in:
Timothy Warren 2012-01-30 16:04:31 -05:00
parent 20bf6d7d19
commit 245a2f78f3
1 changed files with 34 additions and 0 deletions

View File

@ -72,6 +72,40 @@ class DB_PDO extends PDO {
}
// -------------------------------------------------------------------------
/**
* 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 get_rows_changed($statement)
{
// Execute the query
$statement->execute();
// Return number of rows affected
return $statement->rowCount();
}
}
// End of db_pdo.php