PHPCrud Vanilla v1.3
What's new?
// Installing functions Vanilla since v1.3 [ OLD ]
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_API_WINE;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_WINE;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_CREATE;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_FETCH;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_UPDATE;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_DELETE;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_EXTRACT;
// [ NEW ]
// Installing functions Vanilla since v1.3.1.0
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaApiWine;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaWine;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaCreate;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaFetch;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaUpdate;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaDelete;
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VanillaExtract;
// PHPCrud Vanilla : Installing insert function version
new \PHPWineVanillaFlavour\Plugins\PHPCrud\Crud\Wine\VANILLA_CREATE;
// Defined:
wine_creates( string $db_table, array $query = [], string $dataType = null, array $values = null, bool $debug = false);
// CRUD functions version
if( !empty( $create = wine_creates('crud' , [
'friend_name' => '?',
'friend_mobile' => '?',
'friend_email' => '?'
] , "sss" , array(
'name value',
'mobile value',
'email value'
)))) {
echo "Last_id : " . $create . " Added new record! ";
}
/**
* Defined : CRUD multi server or switch to databases
* @since wine v1.3.1.1
* @since vanilla v1.3.0.0
* @since 04.30.2022
**/
wine_multi_server( object $db , vanilla|string $flag, array $method = [] );
// Incase of Create / Insert data to database switch db features Vanilla CRUD since v1.3
if(isset($_REQUEST['insertData']) == true ) {
if( $wine_create = wine_multi_server( new mysqli('localhost','root','','multiserver'), $this->vanilla::MAKE, ['query' => [
'mixed' => [' SQL goes here ']
], 'dataType' => 'sss', 'values'=> array(
// value goes here
), 'debug' => false ] ) ) {
echo "Last_id : " . $wine_create . " Added new record! ";
}
}
/**
* Defined : CRUD api_wine_multi_server / multi server or switch to databases
* @since wine v1.3.1.1
* @since vanilla v1.3.0.0
* @since 04.30.2022
**/
api_wine_multi_server( new mysqli('localhost','root','','multiserver'), [ 'api_wine_makes' => function() {
return [
'debug' => false,
'query' => ['mixed' => [ "SQL goes here" ] ]
];
}], function() { ... }
);
Full Changelog: v1.3...v1.3.1.0