Правка определения типа в подстановке SQL строки

This commit is contained in:
2020-10-22 10:53:23 +06:00
parent ffffd7f926
commit 4056b369b9
2 changed files with 18 additions and 11 deletions

View File

@ -1,4 +1,4 @@
//Шаблон класса для авторизации пользователя (под проекты переделывается)
class DBMSUser class DBMSUser
{ {
constructor(){ constructor(){

View File

@ -77,6 +77,12 @@
$v = str_replace('\'', '\\\'', $v); //так как в SQL строку вставляется $v = str_replace('\'', '\\\'', $v); //так как в SQL строку вставляется
$v = '\'' . $v . '\''; $v = '\'' . $v . '\'';
} }
}if($t=="NULL" || $t==null){
if ($v == '') {
$v = 'NULL';
} else {
$v='\''.$v.'\'';
}
}else{ }else{
$v='\''.$v.'\''; $v='\''.$v.'\'';
} }
@ -619,6 +625,7 @@
$nextnode = $nextnode->nextSibling; $nextnode = $nextnode->nextSibling;
} }
} }
$vType=gettype($_SESSION['USER_ID']);
$sql_query=str_replace('${_user_id}',getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']),$sql_query); $sql_query=str_replace('${_user_id}',getSQLValue(gettype($_SESSION['USER_ID']),$_SESSION['USER_ID']),$sql_query);
if($objListR!=null && $objListR->getAttribute('order')!='' && $objListR->getAttribute('order')!=null && $objListR->getAttribute('order')!='null') if($objListR!=null && $objListR->getAttribute('order')!='' && $objListR->getAttribute('order')!=null && $objListR->getAttribute('order')!='null')
{ {