Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "config.php";
- $data=array();
- $url="http://contoh.com/docs/";
- $cek_kode=mysqli_query($konek, "select title, call_number, image from biblio limit 5");
- $cek=mysqli_num_rows($cek_kode);
- if ($cek_kode==0){
- //echo "Tidak ada koleksi";
- $total=0;
- }
- else
- {
- while ($hasil=mysqli_fetch_array($cek_kode, MYSQLI_ASSOC))
- {
- $hasil['url_gbr']=$url.$hasil['image'];
- $data[]=$hasil;
- }
- $result=[
- 'data'=>$data,
- 'total'=>$total
- ];
- echo json_encode ($result);
- //echo substr($title,10);
- }
- ?>
Add Comment
Please, Sign In to add comment