Fix article
This commit is contained in:
parent
b386ff5fbd
commit
cda602f0ae
@ -52,7 +52,8 @@ function addNewsArticle($title="Nazov", $body="Obsah", $privilegeLevel=0) :array
|
|||||||
$output = ["Status" => "Fail"]; // Default Status is "Fail"
|
$output = ["Status" => "Fail"]; // Default Status is "Fail"
|
||||||
if (isLoggedIn() && $privilegeLevel <= $_SESSION["privilege_level"]) {
|
if (isLoggedIn() && $privilegeLevel <= $_SESSION["privilege_level"]) {
|
||||||
$query = $mysqli->prepare("INSERT INTO NewsArticles (WrittenBy, Title, Body, FileList, PrivilegeLevel) VALUES (?, ?, ?, 0, ?);");
|
$query = $mysqli->prepare("INSERT INTO NewsArticles (WrittenBy, Title, Body, FileList, PrivilegeLevel) VALUES (?, ?, ?, 0, ?);");
|
||||||
$query->bind_param("issi", $_SESSION["ID"], htmlspecialchars($title), htmlspecialchars($body), intval($privilegeLevel));
|
$minpriv = intval($privilegeLevel);
|
||||||
|
$query->bind_param("issi", $_SESSION["ID"], htmlspecialchars($title), htmlspecialchars($body), $minpriv);
|
||||||
$query->execute();
|
$query->execute();
|
||||||
if ($query->affected_rows > 0) {
|
if ($query->affected_rows > 0) {
|
||||||
$output["Status"] = "Success";
|
$output["Status"] = "Success";
|
||||||
|
Loading…
Reference in New Issue
Block a user