<commit_before># Simple-PHP-PDO-Wrapper-Class
A simple database wrapper class in PHP using PDO/MYSQL extension.

# STILL IN DEVELOPMENT<commit_msg>first part of README.<commit_after># Simple-PHP-PDO-Wrapper-Class
A simple database wrapper class in **PHP** using **PDO/MYSQL** extension.
- - - -
### How to Get Started
1. Set up database connection on **db_settings.ini.php** file, like so.
```
[DB]
host     = localhost
dbname   = my_database_name
username = my_username
password = <PASSWORD>
```
2. Require the class.
```php
require_once 'DB.php';
```
3. Create an instance of the DB class.
```php
$db = new DB();
```

### Basic CRUD Examples
Below are examples on how to use the very most basic and easy chaining **CRUD** methods offered by the **DB** Class. 
- - - -

#### INSERT
```php
$insertValues = [
    'name'      => '<NAME>',
    'address'   => 'Cebu City, Philippines',
    'email'     => '<EMAIL>'
];

$affectedRows = $db->insert('users')->values($insertValues);
```

#### UPDATE
```php
$updateValues = [
    'name'      => '<NAME>',
    'address'   => 'Davao City, Philippines',
    'email'     => '<EMAIL>'
];

$affectedRows = $db->update('users')->set($updateValues)->where('id = :id', [':id' => 1]);
```

#### DELETE
```php
$affectedRows = $db->delete('users')->where('id = :id', [':id' => 1]);
```
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.0038022813688212928, 'mean_word_length': 3.802919708029197, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6377080', 'n_tokens_mistral': 465, 'n_tokens_neox': 440, 'n_words': 131}