-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathshowcreate.php
42 lines (35 loc) · 1 KB
/
showcreate.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
<?php
/**
* This file is a part of MyWebSQL package
*
* @file: modules/showcreate.php
* @author Samnan ur Rehman
* @copyright (c) 2008-2014 Samnan ur Rehman
* @web http://mywebsql.net
* @license http://mywebsql.net/license
*/
function processRequest(&$db) {
Session::del('select', 'result');
Session::del('select', 'pkey');
Session::del('select', 'ukey');
Session::del('select', 'mkey');
Session::del('select', 'unique_table');
Session::set('select', 'result', array());
$extraMsg = '';
$type = $_REQUEST["id"];
$name = $_REQUEST["name"];
$cmd = $db->getCreateCommand($type, $name);
$cmd = sanitizeCreateCommand($type, $cmd);
$tm = $db->getQueryTime();
$sql = $db->getLastQuery();
$sql = preg_replace("/[\n\r]/", "<br/>", htmlspecialchars($sql));
$replace = array('TYPE' => $type,
'NAME' => $name,
'COMMAND' => $cmd,
'TIME' => $tm,
'SQL' => $sql,
'MESSAGE' => $extraMsg
);
echo view('showcreate', $replace);
}
?>