Popravek za mysql 8 - po novem je "system" rezervirana beseda

This commit is contained in:
pero1203 2020-11-23 11:00:03 +01:00
parent e755d13e08
commit 5831aad30d
4 changed files with 11 additions and 11 deletions

View File

@ -256,7 +256,7 @@ class SurveyExportProfiles
if ($profileId == 0 ) { // seja -
unset($_SESSION['variables_profile'][self::getSurveyId()]);
} else {
$deleteString = "DELETE FROM srv_variable_profiles WHERE id = '" . $profileId . "' AND system != '1'";
$deleteString = "DELETE FROM srv_variable_profiles WHERE id = '" . $profileId . "' AND `system` != '1'";
$sqlDelete = sisplet_query($deleteString);
}

View File

@ -52,7 +52,7 @@ class SurveyMissingProfiles
self :: addSystemProfiles();
# preberemo podatke vseh porfilov ki so na voljo in jih dodamo v array
$stringSelect = "SELECT * FROM srv_missing_profiles WHERE uid = '".self::getGlobalUserId()."' OR (uid = '0' AND system = 1) ORDER BY id";
$stringSelect = "SELECT * FROM srv_missing_profiles WHERE uid = '".self::getGlobalUserId()."' OR (uid = '0' AND `system` = 1) ORDER BY id";
$querySelect = sisplet_query($stringSelect);
if (mysqli_num_rows($querySelect)) {
@ -392,7 +392,7 @@ class SurveyMissingProfiles
if (isset($pid) && $pid != null) {
# ce mamo sistemski profil ga ne shranjujemo
$checkSelect = "SELECT * as cnt FROM srv_missing_profiles WHERE id = '".$pid."' and system = 1";
$checkSelect = "SELECT * as cnt FROM srv_missing_profiles WHERE id = '".$pid."' and `system` = 1";
$checkQry = sisplet_query($checkSelect);
if (mysqli_num_rows($checkQry) > 0) {
return $pid;
@ -419,7 +419,7 @@ class SurveyMissingProfiles
# imamo podatke, updejtamo profil v bazi (profili z id 1,2,3 so sitemski)
if ($pid > 3) {
# shranimo morebitno spremembo nastavitve display_mv_type
$updateString = "UPDATE srv_missing_profiles SET display_mv_type='".$display_mv_type."', show_zerro='".$show_zerro."', merge_missing='".$merge_missing."' WHERE id='".$pid."' AND system = 0";
$updateString = "UPDATE srv_missing_profiles SET display_mv_type='".$display_mv_type."', show_zerro='".$show_zerro."', merge_missing='".$merge_missing."' WHERE id='".$pid."' AND `system` = 0";
$updatequery = sisplet_query($updateString);
# najprej pobrišemo stare podatke za ta profil
@ -526,7 +526,7 @@ class SurveyMissingProfiles
# izbrišemo lahko samo nesistemske profile
if (self::$profiles[$pid]['system'] != 1) {
# zaradi ključev se avtomatsko pobriše tudi: srv_missing_profiles_values
$sqlDelete = sisplet_query("DELETE FROM srv_missing_profiles WHERE id = '$pid' AND system != '1'");
$sqlDelete = sisplet_query("DELETE FROM srv_missing_profiles WHERE id = '$pid' AND `system` != '1'");
}
}

View File

@ -28,7 +28,7 @@ class SurveyStatusCasi
static function RefreshData() {
# preberemo podatke vseh porfilov ki so na voljo in jih dodamo v array
$stringSelect = "SELECT * FROM srv_status_casi WHERE uid = '".self::getGlobalUserId()."' OR (uid = '0' AND system =1) ORDER BY id";
$stringSelect = "SELECT * FROM srv_status_casi WHERE uid = '".self::getGlobalUserId()."' OR (uid = '0' AND `system` =1) ORDER BY id";
$querySelect = sisplet_query($stringSelect);
while ( $rowSelect = mysqli_fetch_assoc($querySelect) ) {
@ -330,8 +330,8 @@ class SurveyStatusCasi
static function Delete($pid) {
if ($pid != 1) {
$sqlDelete = sisplet_query("DELETE FROM srv_status_casi WHERE id = '$pid' AND system != '1'");
print_r("DELETE FROM srv_status_casi WHERE id = '$pid' AND system != '1'");
$sqlDelete = sisplet_query("DELETE FROM srv_status_casi WHERE id = '$pid' AND `system` != '1'");
print_r("DELETE FROM srv_status_casi WHERE id = '$pid' AND `system` != '1'");
}
}

View File

@ -79,7 +79,7 @@ class SurveyStatusProfiles
self::$profiles[$_SESSION['statusProfile']['id']] = $_SESSION['statusProfile'];
}
# preberemo podatke vseh porfilov ki so na voljo in jih dodamo v array
$stringSelect = "SELECT * FROM srv_status_profile WHERE uid='".self::getGlobalUserId()."' OR ank_id = '".self::$sid."' OR (uid = '0' AND system =1) ORDER BY id";
$stringSelect = "SELECT * FROM srv_status_profile WHERE uid='".self::getGlobalUserId()."' OR ank_id = '".self::$sid."' OR (uid = '0' AND `system`=1) ORDER BY id";
$querySelect = sisplet_query($stringSelect);
while ( $rowSelect = mysqli_fetch_assoc($querySelect) ) {
@ -923,7 +923,7 @@ class SurveyStatusProfiles
}
# izbrišemo lahko samo nesistemske profile
if (self::$profiles[$pid]['system'] != 1) {
$sqlDelete = sisplet_query("DELETE FROM srv_status_profile WHERE id = '$pid' AND system != '1'");
$sqlDelete = sisplet_query("DELETE FROM srv_status_profile WHERE id = '$pid' AND `system` != '1'");
}
self::setDefaultProfileId();
@ -945,7 +945,7 @@ class SurveyStatusProfiles
# preimenujemo lahko samo nesistemske profile
if (self::$profiles[$pid]['system'] != 1)
{
$sqlRename = sisplet_query("UPDATE srv_status_profile SET name='$name' WHERE id = '$pid' AND system != '1'");
$sqlRename = sisplet_query("UPDATE srv_status_profile SET name='$name' WHERE id = '$pid' AND `system` != '1'");
}
}
}