Skip to content

Commit b3b7d9c

Browse files
authored
Update README.md for new Composer Setup
1 parent 7d02174 commit b3b7d9c

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

README.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ This project is a simple database class with php and pdo.
44
## Table of Contents
55
1. [Requirements](#requirements)
66
2. [Installation](#installation)
7+
1. [Using Composer (recommended)](#using-composer-recommended)
8+
2. [Manual Installation](#manual-installation)
79
3. [Basic Usage](#basic-usage)
8-
1. [Require Database Class](#require-database-class)
9-
2. [Instantiate Class / Connect to Database (`__construct()`)](#instantiate-class--connect-to-database-__construct)
10-
3. [Check Connection to Database (`connected()`)](#check-connection-to-database-connected)
11-
4. [Select/Get Data from Database (`select()`)](#selectget-data-from-database-select)
12-
5. [Insert Data into Database (`insert()`)](#insert-data-into-database-insert)
13-
6. [Delete Data/Rows from Database (`delete()`)](#delete-datarows-from-database-delete)
14-
7. [Update Data in Database (`update()`)](#update-data-in-database-update)
15-
8. [Configure Error Handling (`initErrorHandler()`)](#configure-error-handling-initerrorhandler)
16-
9. [Check for Errors (`error()`)](#check-for-errors-error)
17-
10. [Get Errors (`getError()`)](#get-errors-geterror)
10+
1. [Instantiate Class / Connect to Database (`__construct()`)](#instantiate-class--connect-to-database-__construct)
11+
2. [Check Connection to Database (`connected()`)](#check-connection-to-database-connected)
12+
3. [Select/Get Data from Database (`select()`)](#selectget-data-from-database-select)
13+
4. [Insert Data into Database (`insert()`)](#insert-data-into-database-insert)
14+
5. [Delete Data/Rows from Database (`delete()`)](#delete-datarows-from-database-delete)
15+
6. [Update Data in Database (`update()`)](#update-data-in-database-update)
16+
7. [Configure Error Handling (`initErrorHandler()`)](#configure-error-handling-initerrorhandler)
17+
8. [Check for Errors (`error()`)](#check-for-errors-error)
18+
9. [Get Errors (`getError()`)](#get-errors-geterror)
1819
4. [Further Examples / Stuff for Testing](#further-examples--stuff-for-testing)
1920
5. [Contributing](#contributing)
2021
6. [License](#license)
@@ -24,8 +25,22 @@ This project is a simple database class with php and pdo.
2425
- Database, which supports PDO (e.g. MySQL)
2526

2627
## Installation
27-
If you want to use the database class for your own project, you can simply follow these instructions:
28+
If you want to use the database class for your own project, you have two options to install it:
2829

30+
### Using Composer (recommended)
31+
Once you have installed [Composer](https://getcomposer.org/), execute this command:
32+
33+
```
34+
composer require jr-cologne/db-class
35+
```
36+
37+
Then you just have to include the autoloader:
38+
39+
```php
40+
require_once('vendor/autoload.php');
41+
```
42+
43+
### Manual Installation
2944
1. Download the ZIP file of this project
3045
2. Unzip it and save the file `DB.php` to your own project directory.
3146
3. Include the database class into your project like that:
@@ -37,12 +52,7 @@ require_once('path/to/db-class/DB.php');
3752
Now you should be ready to start!
3853

3954
## Basic Usage
40-
If you have successfully "installed" everything, you can use the class like that:
41-
42-
### Require Database Class
43-
```php
44-
require_once('your_path/DB.php');
45-
```
55+
If you have successfully installed everything, use this small guide to learn about using the database class.
4656

4757
### Instantiate Class / Connect to Database (`__construct()`)
4858
To be able to use the class and connect to the database, you have to instantiate it.

0 commit comments

Comments
 (0)