- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
function exeSQL($inSQL,$withDebug = true,$iniDb = '') {
global $db;
$tmp_db = $db;
if ($iniDb != '') {
$tmp_db = $iniDb;
}
if (isset($_SESSION['HIDDEN']) and is_numeric($_SESSION['HIDDEN']['HIDDEN']) and $_GET['HIDDEN'] == 'YES') {
echo "
<br>---------------------------------------------------------------------
BEG_TIME: " . date('h:i:s A');
print "<pre>";
print_r($inSQL);
echo "<br>END_TIME: " . date('h:i:s A') . "<br>
------------------------------------------------------------------------";
}
$result = mysql_query($inSQL, $tmp_db);
$error = mysql_error($tmp_db);
if ($error) {
if (strpos($inSQL, 'USD-CODED_RECORD:V') !== false) {
$strSQL = util::decodeRecord($inSQL);
exeSQL($strSQL, $withDebug);
return ;
}
if ($withDebug) {
// if (!is_dir("d:/temp") and $_GET['debug2'] != 'Y') {
// echo file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/index.html');
// die();
// }
echo $error;
print "<pre>";
print ($inSQL);
die();
}
}
// -- CHECK IF IT WAS INSERTION ---
// -- TRY TO RETURN DATASET
$arr = @mysql_fetch_array($result);
// -- NO RESULT AT ALL
if (is_array($arr)) {
// -- RETURN AS VARCHAR ----
if (count($arr) <= 2) return $arr[0];
// FORM RESULT ARRAY TO RETURN TO USER
$res = array();
while ($arr) {
$res[] = $arr;
$arr = mysql_fetch_array($result);
}
return $res;
} else {
return '';
$id = mysql_insert_id($tmp_db);
if ($id > 0) {
return $id;
}
}
return '';
}
huitka 28.04.2012 09:05 # −3
guest 28.04.2012 14:28 # −4
rO_ot 30.04.2012 12:25 # 0
anycolor 24.08.2021 00:57 # 0
MAKAKA 24.08.2021 15:58 # 0
MAKAKA 24.08.2021 16:02 # 0
MAKAKA 24.08.2021 16:05 # 0
MAKAKA 24.08.2021 16:08 # 0
MAKAKA 24.08.2021 16:09 # 0
MAPTbIwKA 24.08.2021 16:10 # 0
MAPTbIwKA 24.08.2021 16:14 # 0
MAPTbIwKA 24.08.2021 16:15 # 0
MAKAKA 24.08.2021 16:17 # 0
MAPTbIwKA 24.08.2021 16:18 # 0