-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
88 lines (71 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
<?php
require_once('ParserFunctions.php');
/* *** BUILD QUERY *** */
$query = "BUILD users { user_id:int:autoinc:notnull, username:string:notnull };";
p_info('Query', $query);
$buildQuery = new BiscuitBuildQuery($query);
p_var($buildQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
echo '<hr />';
/* *** FETCH QUERY *** */
$query = "FETCH users { [user_id, status] WHERE(status:eq:A) SORT(dsc:user_id) };";
p_info('Query', $query);
$fetchQuery = new BiscuitFetchQuery($query);
p_var($fetchQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
echo '<hr />';
/* *** INSERT QUERY *** */
$query = "INSERT users { user_id:bcd001, age:45, status:A };";
p_info('Query', $query);
$insertQuery = new BiscuitInsertQuery($query);
p_var($insertQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
echo '<hr />';
/* *** DESTROY QUERY *** */
$query = "DESTROY users;";
p_info('Query', $query);
$destroyQuery = new BiscuitDestroyQuery($query);
p_var($destroyQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
echo '<hr />';
/* *** REMOVE QUERY *** */
$query = "REMOVE users { WHERE(username:eq:user001) };";
p_info('Query', $query);
$removeQuery = new BiscuitRemoveQuery($query);
p_var($removeQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
echo '<hr />';
/* *** CHANGE QUERY *** */
$query = "CHANGE users { ADD(join_date:date) };";
p_info('Query', $query);
$changeQuery = new BiscuitChangeQuery($query);
p_var($changeQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
echo '<hr />';
/* *** UPDATE QUERY *** */
$query = "UPDATE users { SET(user_id:123) WHERE(status:eq:A) };";
p_info('Query', $query);
$updateQuery = new BiscuitUpdateQuery($query);
p_var($updateQuery);
// MySQL output test
$mysql_biscuit = new BiscuitMySQL(new BiscuitQuery($query));
p_info('MySQL Output', $mysql_biscuit->getMySQLResult(), 'blue');
?>
<style>
body, pre {
font-family: "Monaco", monospace;
font-size: 14px;
}
</style>