Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'connectdb.php';
- $data = json_decode(file_get_contents('php://input'), true);
- $kodeDosen =$data["kodeDosen"];
- $password = $data["password"];
- $message = array("message"=>"Data found");
- $failure = array("mesage"=>"Data not found");
- if ($stmt = mysqli_prepare($conn, "SELECT kodeDosen, namaDosen, email, telepon FROM tbl_dosen WHERE kodeDosen =? and password = ?")) {
- /* bind parameters for markers */
- mysqli_stmt_bind_param($stmt, "ss", $kodeDosen,$password);
- /* execute query */
- mysqli_stmt_execute($stmt);
- /* store result */
- $result = mysqli_stmt_get_result($stmt);
- $row = mysqli_fetch_assoc($result);
- if(mysqli_num_rows($result) > 0) {
- echo json_encode($row);
- }else {
- echo json_encode($failure);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement