diff --git a/README.md b/README.md
index 984ca00..db546a1 100644
--- a/README.md
+++ b/README.md
@@ -95,6 +95,14 @@ Feel free to take a look. You might learn new things. They have been designed to
- [Redis](databases/redis.sh)
+#### Cheat Class
+
+view cheatsheets
+
+ - [PDO](cheatclass/PDO.php)
+
+
+
### 🔧 Tools
diff --git a/cheatclass/PDO.php b/cheatclass/PDO.php
new file mode 100644
index 0000000..e8058a9
--- /dev/null
+++ b/cheatclass/PDO.php
@@ -0,0 +1,88 @@
+host . ';dbname=' . $this->dbname;
+ $options = array (
+ PDO::ATTR_PERSISTENT => true,
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
+ );
+
+ // Create a new PDO instanace
+ try {
+ $this->dbh = new PDO ($dsn, $this->user, $this->pass, $options);
+ } // Catch any errors
+ catch ( PDOException $e ) {
+ $this->error = $e->getMessage();
+ }
+ }
+
+ // Prepare statement with query
+ public function query($query) {
+ $this->stmt = $this->dbh->prepare($query);
+ }
+
+ // Bind values
+ public function bind($param, $value, $type = null) {
+ if (is_null ($type)) {
+ switch (true) {
+ case is_int ($value) :
+ $type = PDO::PARAM_INT;
+ break;
+ case is_bool ($value) :
+ $type = PDO::PARAM_BOOL;
+ break;
+ case is_null ($value) :
+ $type = PDO::PARAM_NULL;
+ break;
+ default :
+ $type = PDO::PARAM_STR;
+ }
+ }
+ $this->stmt->bindValue($param, $value, $type);
+ }
+
+ // Execute the prepared statement
+ public function execute(){
+ return $this->stmt->execute();
+ }
+
+ // Get result set as Associative array
+ public function resultset(){
+ $this->execute();
+ return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
+ }
+
+ // Get single record as object
+ public function single(){
+ $this->execute();
+ return $this->stmt->fetch(PDO::FETCH_OBJ);
+ }
+
+ // Get record row count
+ public function rowCount(){
+ return $this->stmt->rowCount();
+ }
+
+ // Returns the last inserted ID
+ public function lastInsertId(){
+ return $this->dbh->lastInsertId();
+ }
+}
\ No newline at end of file