daily pastebin goal
90%
SHARE
TWEET

tampil

a guest Oct 23rd, 2017 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //membuat koneksi ke database
  3. $host = 'localhost';
  4.   $user = 'root';      
  5.   $password = '';      
  6.   $database = 'dbperpus';  
  7.   $vcari= $_POST['kode'];
  8.   $konek_db = mysql_connect($host, $user, $password);    
  9.   $find_db = mysql_select_db($database) ;
  10. ?>
  11. <h1 align="center" class="style1"><strong>DATA FINDCODE </strong><strong></strong></h1>
  12. <!-- ///////////////////////////// Script untuk membuat tabel///////////////////////////////// -->
  13.  
  14. <table Width='800'  border='1' align="center">  
  15. <tr>
  16.     <th> kode </th>
  17.     <th> Judul </th>
  18.     <th>Penulis</th>
  19.    </tr>
  20.  
  21. <?php  
  22. // Perintah untuk menampilkan data
  23. $queri=("SELECT * FROM tbbuku WHERE judul LIKE '%$vcari%' ") or die(mysql_error());;  //menampikan SEMUA data dari tabel findcode
  24.  
  25. $hasil=MySQL_query ($queri);    //fungsi untuk SQL
  26.  
  27. // perintah untuk membaca dan mengambil data dalam bentuk array
  28. while ($data = mysql_fetch_array ($hasil)){
  29.  echo "    
  30.        <tr>
  31.        <td>".$data['kode']."</td>
  32.        <td>".$data['judul']."</td>
  33.        <td>".$data['penulis']."</td>
  34.        </tr>
  35.        ";
  36.        
  37. }
  38.  
  39. ?>
  40. </table>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top