-
-
Save simo97/10ac58568d68b85b3bd6df45ba0fcb22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ .'/vendor/autoload.php'; | |
use \JSONDB\Exception as ex; | |
try{ | |
$test = new \JSONDB\JSONDB(); | |
$test->createServer('adonis2','root','root'); | |
$test->connect('adonis2', 'root', 'root'); | |
$test->createDatabase('bank_2'); | |
$test->setDatabase('bank_2'); | |
//$test->createTable('service', array( | |
// 'id' => array( | |
// 'type' => 'int', | |
// 'auto_increment' =>true, | |
// 'primary_key' => true | |
// ) | |
// ) | |
//); | |
$test->createTable('test2', array( | |
'id' => array( | |
'type' => 'int', | |
'auto_increment' =>true, | |
'primary_key' => true | |
) | |
) | |
); | |
$test->createTable('test', array( | |
'id' => array( | |
'type' => 'int', | |
'auto_increment' =>true, | |
'primary_key' => true | |
), | |
'id_test2' => array( | |
'type' => 'link(test2.id)' | |
) | |
) | |
); | |
//$test->createTable('utilisateur', array( | |
// 'id' => array( | |
// 'type' => 'int', | |
// 'auto_increment' =>true, | |
// 'primary_key' => true | |
// ), | |
// 'id_service' => array( | |
// 'type' => 'link(service.id)' | |
// ) | |
// ) | |
//); | |
$test->query('test.insert(1).in(id_test2)'); | |
}catch(ex $d){ | |
echo $d->getMessage(); | |
} |
na2axl
commented
Aug 24, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment