PHP code example of sopheos / pebble_database

1. Go to this page and download the library: Download sopheos/pebble_database 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/ */

    

sopheos / pebble_database example snippets


$qb = new QB('ma_table')
$qb->whereEq('id', 1);
$query = $qb->read();

$qb->orderBy('etat', 'dat_creatione_creation desc');
$qb->orderAsc('etat')->orderDesc('date_creation');

$forge = DBForge::create()

function(Column $column) {
    $column->char(40);
}

DBForge::create()
    ->addColumn('id', function(Column $col) {
        $col->type('int', 11)->unsigned()->autoIncrement();
    })
    ->addColumn('name', function(Column $col) {
        $col->type('varchar', 50)->notNull();
    })
    ->addColumn('captain', function(Column $col) {
        $col->->type('int', 11)->unsigned();
    })
    ->addColumn('assistant'function(Column $col) {
        $col->->type('int', 11)->unsigned();
    })
    ->addPrimary('id')
    ->addFk('captain', 'players.id')
    ->addFk('assistant', 'players.id')
    ->createTable('tests.teams')

DBForge::create()
    ->changeColumn('id', function(Column $col) {
    $col->type('int', 11)->unsigned()->autoIncrement();
    })
    ->addPrimary('id')
    ->alterTable('tests.teams')