alifcintaibu

tdk_bisa_looping_database

May 6th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2. include 'index2.php';
  3. include 'fungsi2.php';
  4.  
  5. $con = mysql_connect("localhost","root","");
  6. if (!$con) {
  7. die('Koneksi ke database gagal: ' . mysql_error());
  8. }
  9. mysql_select_db("uji1", $con);
  10. mysql_query("truncate table `tbberita`");
  11. mysql_query("truncate table `tbkeyword`");
  12. mysql_query("truncate table `tbstem`");
  13. mysql_query("truncate table `tbtoken`");
  14.  
  15. echo "<a href=aksi.php?act=hapus_semua>Hapus semua data</a>
  16. <h3> Daftar Berita Acak: </h3>";
  17. $berita = mysql_query("SELECT id,url,content FROM tb_content ORDER BY RAND() LIMIT 10");
  18.  
  19. $tampil_indeks_dokumen=mysql_num_rows($berita);
  20. echo "Jumlah Dokumen Yang Di Indeks : ".$tampil_indeks_dokumen;
  21.  
  22. echo "  <form method='POST'>
  23.          <input type=\"submit\" value='Stem!' name=\"stem_database\" />
  24. </form>";
  25. if(isset($_POST['stem_database'])){
  26. $ambil_database = mysql_query("SELECT content FROM tb_content ORDER BY RAND() LIMIT 10");
  27.  
  28. while ($stemming = mysql_fetch_array($ambil_database)){
  29.     $string = "$stemming[content]";
  30.    
  31.     stemming3($string);
  32.  
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment