wplibs / database
WordPress database query builder, based on illuminate/database
Installs: 1 217
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.6.0
- mrjgreen/database: ^2.5
Requires (Dev)
- phpunit/phpunit: 4.8.*|5.7.*
This package is auto-updated.
Last update: 2024-11-10 22:05:24 UTC
README
Installation
composer require wplibs/database:^1.0
Usage
Basic Example
<?php use WPLibs\Database\Database; $builder = Database::newQuery()->select( '*' )->from( 'posts' ); var_dump( $posts = $builder->get() ); var_dump( $builder->toSql() ); // select * from `{$wpdb->posts}`
The query above can be shorten by this:
$posts = Database::table( 'posts' )->get();