1- # PHP ORM Database
2- [ ![ Total Downloads] ( https://poser.pugx.org/peterson/php-orm-database/downloads )] ( https://packagist.org/packages/peterson/php-orm-database )
3- [ ![ Latest Stable Version] ( https://poser.pugx.org/peterson/php-orm-database/version.png )] ( https://packagist.org/packages/peterson/php-orm-database )
4- [ ![ License] ( https://poser.pugx.org/peterson/php-orm-database/license )] ( https://packagist.org/packages/peterson/php-orm-database )
5- [ ![ Build Status] ( https://github.com/tamedevelopers/phpOrmDatabase/actions/workflows/php.yml/badge.svg )] ( https://github.com/tamedevelopers/phpOrmDatabase/actions )
6- [ ![ Code Coverage] ( https://codecov.io/gh/peterson/php-orm-database/branch/2.2.x/graph/badge.svg )] ( https://codecov.io/gh/peterson/php-orm-database/branch/2.2.x )
7- [ ![ Gitter] ( https://badges.gitter.im/peterson/php-orm-database.svg )] ( https://app.element.io/#/room/#php-orm-database:gitter.im )
1+ # Lightweight PHP ORM Database [ Fredrick Peterson]
2+ [ ![ Total Downloads] ( https://poser.pugx.org/peterson/phpOrmDatabase/downloads )] ( https://packagist.org/packages/peterson/phpOrmDatabase )
3+ [ ![ Latest Stable Version] ( https://poser.pugx.org/peterson/phpOrmDatabase/version.png )] ( https://packagist.org/packages/peterson/phpOrmDatabase )
4+ [ ![ License] ( https://poser.pugx.org/peterson/phpOrmDatabase/license )] ( https://packagist.org/packages/peterson/phpOrmDatabase )
85
96## Inspiration
107
11- Having been introduced to learning Laravel Framework; Over the past yr(s), Coming back to vanilla PHP,
12- was pretty tough. So i decided to create a much more easier way of communicating with Database, using native ` PHP PDO:: Driver ` .
8+ Having be instroduced to Laravel Framework, over the past yr(s), Coming back to vanilla PHP database ,
9+ was pretty tough. So i decided to create a much more easier way of communicating with Database.
1310
1411
1512
@@ -27,8 +24,8 @@ was pretty tough. So i decided to create a much more easier way of communicating
2724 * [ Delete] ( #delete )
2825 * [ Increment] ( #increment )
2926 * [ Decrement] ( #decrement )
27+ * [ Query] ( #query )
3028 * [ Remove Tags] ( #remove-tags )
31- * [ Raw] ( #raw )
3229* [ Fetching Data] ( #fetching-data )
3330 * [ Get] ( #get )
3431 * [ First] ( #first )
@@ -49,6 +46,7 @@ was pretty tough. So i decided to create a much more easier way of communicating
4946 * [ Pagination Showing] ( #pagination-showing )
5047 * [ Pagination Showing Config] ( #pagination-showing-config )
5148* [ Clause] ( #clause )
49+ * [ Raw] ( #raw )
5250 * [ select] ( #select )
5351 * [ orderBy] ( #orderby )
5452 * [ orderByRaw] ( #orderbyraw )
@@ -331,18 +329,18 @@ $db->table('users')
331329 ]);
332330```
333331
334- ### Raw
335- - Allows you to use direct raw ` SQL query syntax `
332+ ### Query
333+ - Allows you to use direct ` SQL query syntax `
336334
337335- 1 usage
338336```
339- $db->raw ('SHOW COLUMNS FROM users')->get();
340- $db->raw ('DROP TABLE users; ')->execute();
337+ $db->query ('SHOW COLUMNS FROM users')->get();
338+ $db->query ('DROP TABLE users')->execute();
341339```
342340
343341- 2 usage
344342```
345- $db->raw ('SELECT count(*) FROM users WHERE status=:status');
343+ $db->query ('SELECT count(*) FROM users WHERE status=:status');
346344$db->bind('status', 1);
347345$db->get();
348346
@@ -622,7 +620,23 @@ $users->showing([
622620## Clause
623621- Multiple clause
624622
625- ### Select
623+ <details >
624+ <summary >Raw</summary >
625+ - Allows you to use direct raw ` SQL query syntax `
626+
627+ - 1 usage
628+ ```
629+ $db->table()
630+ ->raw('date >= $date')
631+ ->raw('NOW() > created_at')
632+ ->get();
633+
634+ $db->raw('DROP TABLE users')->execute();
635+ ```
636+ </details >
637+
638+ <details >
639+ <summary >Select</summary >
626640- Used to select needed columns from database
627641```
628642$db->table('users')
@@ -636,6 +650,7 @@ SELECT first_name, email
636650 WHERE user_id=:user_id
637651 LIMIT 1
638652```
653+ </details >
639654
640655### orderBy
641656- Takes two param ` $column ` and ` $direction `
@@ -664,6 +679,8 @@ SELECT *
664679 ORDER By CAST(`amount` AS UNSIGNED) DESC
665680```
666681
682+
683+
667684### Latest
668685- Takes one param ` $column ` by default the column used is ` id `
669686```
@@ -1171,7 +1188,8 @@ class PostClass extends DB{
11711188## Useful Links
11721189
11731190- @author Fredrick Peterson (Tame Developers)
1174- - [ Lightweight - PHP ORM Database] ( https://github.com/tamedevelopers/phpOrmDatabase )
1191+ - [ Ultimate ORM Database] ( https://github.com/tamedevelopers/phpOrmDatabase )
11751192- If you love this PHP Library, you can [ Buy Tame Developers a coffee] ( https://www.buymeacoffee.com/tamedevelopers )
1193+ - Link to Youtube Video Tutorial on usage will be available soon
11761194- Udemy Course on Usage [ Coming Soon] ( )
11771195
0 commit comments