-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdb-test.php
More file actions
42 lines (31 loc) · 989 Bytes
/
db-test.php
File metadata and controls
42 lines (31 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Vanderbilt\AdvancedImport;
use Vanderbilt\AdvancedImport\App\Models\Import;
use Vanderbilt\AdvancedImport\App\Models\Queue\Job;
use Vanderbilt\AdvancedImport\App\Models\Queue\ImportJob;
$page = new \HtmlPage();
$page->PrintHeaderExt();
include APP_PATH_VIEWS . 'HomeTabs.php';
$module_path = $module->getModulePath();
include($module_path.'header.php');
$table_name = 'test';
$db = AdvancedImport::colDb();
$db->createTable($table_name, ['fields'=>['first_name','last_name','email']], $drop=true);
$metadata = $db->getMetadata($table_name);
$db->insert($table_name, [
'first_name'=> 'francesco',
'last_name'=> 'delacqua',
'email'=> 'francesco.delacqua@vumc.org'
]);
$generator = $db->search($table_name, '`id`=?', [1]);
while($row = $generator->current()) {
$first_name = @$row['first_name'];
echo $first_name;
$generator->next();
}
$db->dropTable('test');
$metadata = $db->getMetadata($table_name);
?>
<?php
$page->PrintFooterExt();
?>