PHP code example of waxim / woodhouse

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

    

waxim / woodhouse example snippets


$woodhouse = (new Woodhouse);
$woodhouse->user()->create(($username = 'testing'), ($password = 'testing'));

// ... create a table

# Then give the user permissions to the table
$woodhouse->user()->allow(($username = 'testing'), ($table = 'table_name'));

# Or take the permission away again
$woodhouse->user()->deny(($username = 'testing'), ($table = 'table_name'));

# Delete the user
$woodhouse->user()->delete(($username = 'testing'));

# We can even test if a user has permissions to a table
$woodhouse->user()->has(($username = 'testing'), ($table = 'table_name'));

# We can also get a list of all our tables
$tables = $woodhouse->user()->table()->list();
foreach($tables as $table) {
    echo $table->tablename;
}