PHP code example of thatzokay / wpdb-builder

1. Go to this page and download the library: Download thatzokay/wpdb-builder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thatzokay / wpdb-builder example snippets


use \WpdbBuilder\Builder;

var_dump(( Builder::table( 'posts' )->all() );

$sql = $wpdb->prepare( "SELECT * FROM {$wpdb->posts} WHERE id = %s LIMIT 1", 1 );
$result = $wpdb->get_row( $sql );

$result = Builder::table('posts')->where('id', 1)->first();