1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-05 03:24:41 +00:00

Version 1.2.5

This commit is contained in:
だいちまる
2023-08-19 17:49:56 +09:00
committed by GitHub
parent 6845f31a4a
commit 9ede52e05e
74 changed files with 9283 additions and 6961 deletions
+2 -2
View File
@@ -25,8 +25,8 @@ $option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
$userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']);
try {
+40 -40
View File
@@ -1,40 +1,40 @@
<?php
//------------------------------------------
// データベースに接続
try {
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
$sql = "SELECT title, note, account, datetime FROM notice ORDER BY datetime DESC";
$notice_array = $pdo->query($sql);
while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
$notices[] = $row;
}
if(!empty($notices)){
foreach ($notices as $value) {
$uneinoticenote = $value['note'];
$uneinoticetitle = $value['title'];
$uneinoticeaccount = $value['account'];
$uneinoticedatetime = $value['datetime'];
}
}else{
$uneinoticenote = "";
$uneinoticetitle = "おしらせはありません";
$uneinoticeaccount = "uwuzu";
$uneinoticedatetime = "";
}
<?php
//------------------------------------------
// データベースに接続
try {
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
$sql = "SELECT title, note, account, datetime FROM notice ORDER BY datetime DESC";
$notice_array = $pdo->query($sql);
while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
$notices[] = $row;
}
if(!empty($notices)){
foreach ($notices as $value) {
$uneinoticenote = htmlentities($value['note']);
$uneinoticetitle = htmlentities($value['title']);
$uneinoticeaccount = htmlentities($value['account']);
$uneinoticedatetime = htmlentities($value['datetime']);
}
}else{
$uneinoticenote = "";
$uneinoticetitle = "おしらせはありません";
$uneinoticeaccount = "uwuzu";
$uneinoticedatetime = "";
}