Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con= mysqli_connect("localhost","root","agung_110793","TA_PenjualanBuku");
- if (mysqli_connect_errno() ){
- echo "Failed to eonnect to mysql:" . mysqli_connect_errno();
- }
- function pencarian(){
- if (isset($_GET['Search'])){
- $search_query = $_GET['user_query'];
- $cek = "SELECT * FROM buku where searching like '%$search_query%' ";
- $run_query = mysqli_query($con,$cek);
- while ($cari=mysqli_fetch_array($run_query)){
- $judul = $cari['judul_buku'];
- $harga = $cari['harga'];
- $pro_brand = $cari['discount_buku'];
- $pro_title = $cari['tahun_terbit'];
- $pro_price = $cari['bahasa'];
- $pro_image = $cari['gambar_buku'];
- echo "
- <div id='single_product'>
- <h3>$judul</h3>
- <img src='admin/buku_images/$pro_image' width='180' height='180' />
- <p> <b> Rp. $harga </b> </p>
- <a href='datails.php?pro_id=$pro_id' style='float:left;' >Details</a>
- <a href='index.php?pro_id=$pro_is'><button style='float:right'>Add to cart</button></a>
- </div>
- ";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement