PHP code example of zortje / mysql-keeper

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

    

zortje / mysql-keeper example snippets


$pdo = new PDO('mysql:host=127.0.0.1;dbname=myapp', 'root', '');

$database = DatabaseFactory::create($pdo);
$databaseResult = $database->getResult();

[
	'users' => [
		'issues' => [
			[
				'type' => 'field',
				'field' => 'id',
				'description' => 'Set as auto_increment but has no primary key'
			],
			[
				'type' => 'field',
				'field' => 'id',
				'description' => 'Set as auto_increment but is not set as primary'
			]
		],
		'optimizations' => [
			[
				'type' => 'field',
				'field' => 'id',
				'description' => 'Field should be unsigned, as no field values are negative'
			]
		]
	]
];



<<<CONFIG
packages:
    - "zortje/mysql-keeper": "~0.0"
CONFIG;

$pdo = new PDO('mysql:host=127.0.0.1;dbname=myapp', 'root', '');

$database = Zortje\MySQLKeeper\DatabaseFactory::create($pdo);

print_r($database->getResult());

$ melody run mysql-keeper_myapp.php