Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karmek-k/php-crud
An example book manager using vanilla PHP.
https://github.com/karmek-k/php-crud
Last synced: 3 days ago
JSON representation
An example book manager using vanilla PHP.
- Host: GitHub
- URL: https://github.com/karmek-k/php-crud
- Owner: karmek-k
- License: mit
- Created: 2021-02-13T11:43:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-14T17:08:27.000Z (over 3 years ago)
- Last Synced: 2023-06-30T14:32:56.078Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-crud
An example book manager using vanilla PHP.## Installation
You should have PHP7 (or higher) installed.
You will also need a RDBMS (I used PostgreSQL, but I think others will work as well)
and its PDO driver.Review the DB credentials in `src/utils/db_config.php`:
```php
'pgsql:host=localhost;port=5432;dbname=php-book-mgr',
'username' => 'php-book-mgr',
'password' => 'you-cannot-guess',
];
```Set them to whatever you want.
After that, run `init.php`.
```
php init.php
```You should receive a nice message saying that the `books` table has been created.
Now can test the app using the built-in PHP server:
```
php -S localhost:8000 -t src
```If you get an error, **make sure that you have enabled the desired PDO extension!**