mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
fix, mysql error: Field 'is_global' doesn't have a default value
This commit is contained in:
parent
e3e099680c
commit
f8142218ef
@ -438,16 +438,15 @@ function WriteConfigValue($szPropName, $is_global = true, $userid = false, $grou
|
|||||||
if ( !isset($rows) )
|
if ( !isset($rows) )
|
||||||
{
|
{
|
||||||
// New Entry
|
// New Entry
|
||||||
$result = DB_Query("INSERT INTO `" . DB_CONFIG . "` (propname, propvalue, userid) VALUES ( '" . $szPropName . "', '" . $szDbValue . "', " . $userid . ")");
|
$sql_query = sprintf("INSERT INTO `%s` (propname, propvalue, userid, is_global) VALUES ( '%s', '%s', %d, %d )", DB_CONFIG, $szPropName, $szDbValue, $userid, ($is_global ? 1 : 0) );
|
||||||
DB_FreeQuery($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Update Entry
|
// Update Entry
|
||||||
$result = DB_Query("UPDATE `" . DB_CONFIG . "` SET propvalue = '" . $szDbValue . "' WHERE propname = '" . $szPropName . "' AND userid = " . $userid);
|
$sql_query = sprintf("UPDATE `%s` SET propvalue = '%s' WHERE propname = '%s' AND userid = %d", DB_CONFIG, $szDbValue, $szPropName, $userid);
|
||||||
DB_FreeQuery($result);
|
|
||||||
}
|
}
|
||||||
|
$result = DB_Query($sql_query);
|
||||||
|
DB_FreeQuery($result);
|
||||||
}
|
}
|
||||||
else if ( $groupid != false )
|
else if ( $groupid != false )
|
||||||
DieWithFriendlyErrorMsg( "Critical Error occured in WriteConfigValue, writing GROUP specific properties is not supported yet!" );
|
DieWithFriendlyErrorMsg( "Critical Error occured in WriteConfigValue, writing GROUP specific properties is not supported yet!" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user