Skip to content
Snippets Groups Projects
Commit a2cc3f21 authored by Husnulzaki Wibisono Haryadi's avatar Husnulzaki Wibisono Haryadi
Browse files

Delete 'tgl' parameter from query

parent e4aeddbc
Branches
No related merge requests found
......@@ -10,18 +10,22 @@
*/
require 'dbConnect.php';
$tgl = $_POST["tgl"];
$komentar = $_POST["komentar"];
$user_id = $_POST["user_id"];
$berita_id = $_POST["berita_id"];
$stmt = $conn->prepare("INSERT INTO kmt_berita(
tgl, komentar, user_id, berita_id
) VALUES (?,?,?,?)");
komentar, user_id, berita_id
) VALUES (?,?,?)");
$stmt->bind_param("ssii", $tgl, $komentar, $user_id, $berita_id);
$stmt->execute();
$stmt->bind_param("sii", $komentar, $user_id, $berita_id);
$status = $stmt->execute();
$stmt->close();
$conn->close();
echo "Sukses, komentar oleh user id " . $user_id ." pada berita " . $berita_id . " berhasil ditambahkan.";
if ($status) {
echo "Sukses, komentar oleh user id " . $user_id ." pada pengumuman " . $pengumuman_id . " berhasil ditambahkan.";
} else {
echo "Gagal, komentar tidak berhasil ditambahkan.";
}
......@@ -10,18 +10,22 @@
*/
require 'dbConnect.php';
$tgl = $_POST["tgl"];
$komentar = $_POST["komentar"];
$user_id = $_POST["user_id"];
$pengumuman_id = $_POST["pengumuman_id"];
$stmt = $conn->prepare("INSERT INTO kmt_pengumuman(
tgl, komentar, user_id, pengumuman_id
) VALUES (?,?,?,?)");
komentar, user_id, pengumuman_id
) VALUES (?,?,?)");
$stmt->bind_param("ssii", $tgl, $komentar, $user_id, $pengumuman_id);
$stmt->execute();
$stmt->bind_param("sii", $komentar, $user_id, $pengumuman_id);
$status = $stmt->execute();
$stmt->close();
$conn->close();
echo "Sukses, komentar oleh user id " . $user_id ." pada pengumuman " . $pengumuman_id . " berhasil ditambahkan.";
if ($status) {
echo "Sukses, komentar oleh user id " . $user_id ." pada pengumuman " . $pengumuman_id . " berhasil ditambahkan.";
} else {
echo "Gagal, komentar tidak berhasil ditambahkan.";
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment