forked from dexterns88/fenix_db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
98 lines (74 loc) · 2.5 KB
/
index.php
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
include_once('krumo/class.krumo.php'); // krumo developer mode
include_once('ini_db.php');
//~ header('Location: demo.html');
// call db function
$db = new fenix_DbConect();
$db -> conect();
// select data base return value ==================================================
$arr_base = array(
'table' => 'test_base',
'select' => array(
'id',
'text'
),
'where' => 'text = "djuro" '
//'order' => ''
);
$baseApi = new Fenix_baseApi();
//~ $value = $baseApi -> fx_select( $arr_base );
//~ krumo($value);
// insert data into table ===================================================================================================
$arr_base_insert = array(
'table' => 'new_table4',
'value' => array(
'FirstName' => 'dexter',
'LastName' => 'more test',
'Age' => '2'
)
);
//~ $value2 = $baseApi -> fx_insert( $arr_base_insert );
//~ krumo($value2);
// delete data from database =========================================================================================
$arr_base_delete = array(
'table' => 'test_base',
// 'where' => ' "id" = 3 or "text" = "dex" '
'where' => ' id = 8 '
);
//~ $val3 = $baseApi -> fx_delete($arr_base_delete);
//~ krumo($val3);
// create table ======================================================================================================
$arr_base_create_table = array(
'table' => 'new_table4',
'tableType' => 'innodb', // defalut parametar if not entered
'value' => array(
//'id' => 'int NOT NULL AUTO_INCREMENT',
'FirstName' => 'varchar(15)',
'LastName' => 'varchar(15)',
'Age' => 'int'
),
//~ 'primary' => 'id'
);
//~ $value3 = $baseApi -> fx_createTable($arr_base_create_table);
//~ krumo($value3);
// list of table ================================================================================================
//~ $list = $baseApi -> fx_tableList();
//~ krumo($list);
// update value into table ================================================================================================
$arr_base_update = array(
'table' => 'new_table',
'value' => array(
'FirstName' => 'sasa',
'LastName' => 'des'
),
'where' => "id = 1 or age = 22"
);
//~ $update = $baseApi -> fx_update( $arr_base_update );
//~ krumo($update);
// drop table ===============================================================================================================
$arr_base_drop = array(
'table' => 'new_table1'
);
//~ $drop = $baseApi -> fx_drop( $arr_base_drop );
//~ krumo($drop);
?>