Add files via upload

This commit is contained in:
gapradana123 2022-12-12 16:44:21 +07:00 committed by GitHub
parent be603b91f1
commit ec754a7e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 116 additions and 0 deletions

12
adddata.php Normal file
View File

@ -0,0 +1,12 @@
<?php
include 'conn.php';
$nama = $_POST['nama'];
$email = $_POST['email'];
$password = $_POST['password'];
$wallet = $_POST['wallet'];
$connect->query("INSERT INTO profil (nama, email, password, wallet) VALUES ('".$nama."','".$email."','".$password."','".$wallet."')")
?>

10
conn.php Normal file
View File

@ -0,0 +1,10 @@
<?php
$connect = new mysqli("localhost","root","","validator");
if($connect){
}else{
echo "Connection Failed";
exit();
}

12
editdata.php Normal file
View File

@ -0,0 +1,12 @@
<?php
include 'conn.php';
$id = $_POST['id'];
$nama = $_POST['nama'];
$email = $_POST['email'];
$password = $_POST['password'];
$connect->query("UPDATE profil SET nama='".$nama."', email='".$email."', password='".$password."' WHERE id=". $id);
?>

7
list.php Normal file
View File

@ -0,0 +1,7 @@
<?php
$connection = new mysqli("localhost","root","","validator");
$data = mysqli_query($connection, "select * from profil");
$data = mysqli_fetch_all($data, MYSQLI_ASSOC);
echo json_encode($data);

75
validator.sql Normal file
View File

@ -0,0 +1,75 @@
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 12, 2022 at 10:26 AM
-- Server version: 10.4.25-MariaDB
-- PHP Version: 8.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `validator`
--
-- --------------------------------------------------------
--
-- Table structure for table `profil`
--
CREATE TABLE `profil` (
`nama` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`password` varchar(70) NOT NULL,
`wallet` varchar(70) NOT NULL,
`img` varchar(70) NOT NULL,
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `profil`
--
INSERT INTO `profil` (`nama`, `email`, `password`, `wallet`, `img`, `id`) VALUES
('Your Name', 'blablabla@gmail.com', 'blablabla', '0xH993J4bEbdb8q8h1n11hdbfb084b77cgwii2jk0a', '', 1),
('Woody', 'woody123@gmail.com', 'woody123', '0x2bAKLiisI9343bbbq8818u12b88heh11ndh1najz', '', 2),
('Buzz Lightyear', 'buzz123@gmail.com', 'buzz123', '0x2cAKLiisI9343bbbq8818u12b88heh11ndh1najz', '', 3),
('Lembaga Penerbit 1', 'penerbit1@gmail.com', 'penerbit1', '0x2aAKLiisI9343bbbq8818u12b88heh11ndh1najz', '', 4),
('Lembaga Penerbit 2', 'penerbit2@gamil.com', 'penerbit2', '0x3aAKLiisI9343bbbq8818u12b88heh11ndh1najz', '', 5),
('Sekolah 1', 'sekolah1@gmail.com', 'sekolah1', '0x4aAKLiisI9343bbbq8818u12b88heh11ndh1najz', '', 6),
('Sekolah 2', 'sekolah2@gmail.com', 'sekolah2', '0x5aAKLiisI9343bbbq8818u12b88heh11ndh1najz', '', 7);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `profil`
--
ALTER TABLE `profil`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `profil`
--
ALTER TABLE `profil`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;