kura2yamato

fix 114

Sep 19th, 2020
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2. include "config.php";
  3.  
  4. $data=array();
  5. $url="http://contoh.com/docs/";
  6.  
  7. $cek_kode=mysqli_que­ry($konek, "select title, call_number, image from biblio limit 5");
  8.  
  9.  
  10. $cek=mysqli_num_rows­($cek_kode);
  11. if ($cek_kode==0){
  12. //echo "Tidak ada koleksi";
  13.     $total=0;  
  14. }
  15. else
  16. {
  17. while ($hasil=mysqli_fetch­_array($cek_kode, MYSQLI_ASSOC))
  18. {
  19.     $hasil['url_gbr']=$url.$hasil['image'];
  20.     $data[]=$hasil;
  21.  
  22. }
  23.  
  24. $result=[
  25. 'data'=>$data,
  26. 'total'=>$total
  27. ];
  28. echo json_encode ($result);
  29. //echo substr($title,10);
  30.  
  31. }
  32. ?>
Add Comment
Please, Sign In to add comment