mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 18:04:54 +02:00
Fixed several bugs with old SQL code.
This commit is contained in:
@@ -8,7 +8,7 @@ if (empty($_POST) === false) {
|
||||
// Delete
|
||||
if ($action === 'd') {
|
||||
echo '<font color="green"><b>News deleted!</b></font>';
|
||||
mysql_query("DELETE FROM `znote_news` WHERE `id`='$id';");
|
||||
mysql_delete("DELETE FROM `znote_news` WHERE `id`='$id';");
|
||||
$cache = new Cache('engine/cache/news');
|
||||
$news = fetchAllNews();
|
||||
$cache->setContent($news);
|
||||
@@ -61,7 +61,7 @@ if (empty($_POST) === false) {
|
||||
echo '<font color="green"><b>News created successfully!</b></font>';
|
||||
list($charid, $title, $text) = array((int)$_POST['selected_char'], mysql_real_escape_string($_POST['title']), mysql_real_escape_string($_POST['text']));
|
||||
$date = time();
|
||||
mysql_query("INSERT INTO `znote_news` (`title`, `text`, `date`, `pid`) VALUES ('$title', '$text', '$date', '$charid');");
|
||||
mysql_insert("INSERT INTO `znote_news` (`title`, `text`, `date`, `pid`) VALUES ('$title', '$text', '$date', '$charid');");
|
||||
// Reload the cache.
|
||||
$cache = new Cache('engine/cache/news');
|
||||
$news = fetchAllNews();
|
||||
@@ -72,7 +72,7 @@ if (empty($_POST) === false) {
|
||||
if ($action === 's') {
|
||||
echo '<font color="green"><b>News successfully updated!</b></font>';
|
||||
list($title, $text) = array(mysql_real_escape_string($_POST['title']), mysql_real_escape_string($_POST['text']));
|
||||
mysql_query("UPDATE `znote_news` SET `title`='$title',`text`='$text' WHERE `id`='$id';") or die("FUCK!");
|
||||
mysql_update("UPDATE `znote_news` SET `title`='$title',`text`='$text' WHERE `id`='$id';") or die("FUCK!");
|
||||
$cache = new Cache('engine/cache/news');
|
||||
$news = fetchAllNews();
|
||||
$cache->setContent($news);
|
||||
|
Reference in New Issue
Block a user