示例#1
0
文件: add.php 项目: vostvesh/News_OOP
<?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");
}
示例#2
0
<?php

require_once __DIR__ . "/../config.php";
require_once __DIR__ . "/../DBModify.php";
$MyNews = new DBModify(SERVER, USER, PASS, DB);
$allNews = $MyNews->getAllDB("*", "test_name", "1");
示例#3
0
<?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");
}