Advertisement
Guest User

load_data_petugas php

a guest
Feb 20th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. <?php
  2. include "koneksi.php";
  3. include "notice.php";
  4.  if($_SERVER['REQUEST_METHOD']=='POST'){
  5.          
  6.          $email = $_POST['email'];
  7.         // $email = 'as@gmail.com';
  8. /*
  9.          if($email!=""){
  10.             $sql = "SELECT * FROM user WHERE id_user='$email' ";
  11.             $result = $conn->query($sql);
  12.          }
  13. */       
  14.  
  15. $sql = "SELECT a.* FROM daftar_usaha_umkm a
  16.         JOIN user b on b.id_user=a.id_user
  17.         WHERE b.email='$email' ";
  18. $result = $conn->query($sql);
  19.  
  20. if ($result->num_rows >0) {
  21.      // output data of each row
  22.      while($row[] = $result->fetch_assoc()) {
  23.      
  24.          $tem = $row;
  25.          
  26.          $json = json_encode($tem);
  27.      echo "success";
  28.      
  29.      }
  30.  
  31.     echo $json;
  32.     $conn->close();
  33.  
  34. }
  35.  
  36.     }else {
  37.  
  38.       echo "Pesan Web : Tidak Konek dengan Server";
  39.  
  40.     }
  41.  
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement