SHOW:
|
|
- or go back to the newest paste.
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)){ |
28 | + | while ($stemming = mysql_fetch_array($ambil_database)){ |
29 | - | $string = "$stemming[content]"; |
29 | + | $ar[]=$stemming; |
30 | - | |
30 | + | |
31 | - | stemming3($string); |
31 | + | echo "<br>total=".count($a); |
32 | foreach($ar as $a){ | |
33 | $string = "$a[content]"; | |
34 | stemming3($string); | |
35 | } | |
36 | echo "end"; | |
37 | } |