<?php require_once __DIR__ . "/../config.php"; require_once __DIR__ . "/../DBModify.php"; $title = $_POST['title']; $text = $_POST['text']; $date = $_POST['date']; $AddNews = new DBModify(SERVER, USER, PASS, DB); if ($AddNews->insertDB(DB_NAME, "title, text, date", "'{$title}', '{$text}', '{$date}'")) { header("Location: /News_OOP/index.php"); }
<?php require_once __DIR__ . "/../config.php"; require_once __DIR__ . "/../DBModify.php"; $MyNews = new DBModify(SERVER, USER, PASS, DB); $allNews = $MyNews->getAllDB("*", "test_name", "1");
<?php require_once __DIR__ . "/../config.php"; require_once __DIR__ . "/../DBModify.php"; $title = $_POST['title']; $text = $_POST['text']; $date = $_POST['date']; $id = $_POST['id']; $UpdateNews = new DBModify(SERVER, USER, PASS, DB); if ($UpdateNews->updateDB(DB_NAME, "title='{$title}', text='{$text}', date='{$date}'", "id='{$id}'")) { header("Location: /News_OOP/index.php"); }