Created
November 20, 2020 14:31
-
-
Save sinyo1015/eba9653314997e7bda842e122856c11d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connection = mysqli_connect("localhost", "root", "", "tb_apalah"); | |
//Ambil Status | |
$user = "1"; | |
$query2 = mysqli_query($connection, "SELECT status FROM tbnya WHERE id_user = '$user'"); | |
$result = mysqli_fetch_row($query2); | |
//Ambil status | |
$hasil = $result['status']; | |
//Update Status | |
$user = $_POST['user_id']; | |
$status = $_POST['status'];//Anggap 0 masih dp, 1 masih belum lunas, dan 2 lunas | |
$sql = mysqli_query($connection, "UPDATE tbnya SET status = '$status' WHERE id_user = '$user'"); | |
Author
sinyo1015
commented
Nov 20, 2020
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<form>
<div>
<label>ID User</label>
<input name="id_user" value="1" readonly />
</div>
<div>
<label>Status</label>
<select name="status" id="">
<option value="0">DP</option>
<option value="1">Belum Lunas</option>
<option value="2">Lunas</option>
</select>
</div>
<button type="submit">Kirim</button>
</form>
</div>
</body>
</html>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment