Advertisement:

Author Topic: Menampilkan Topik berdasarkan board/category di php  (Read 1837 times)

Offline bendol212

  • Newbie
  • *
  • Posts: 1
Menampilkan Topik berdasarkan board/category di php
« on: October 05, 2014, 11:33:08 AM »
permisi gan....ane pengen menampilkan topik di php tp berdasarkan id board...
atau WHERE id boards...??

ane coba buat secara langsung, ga pake ssi.php karena ane belum pahamnya...

setelah ane coba langsung bisa sih...tp kurang fleksible
Code: [Select]
$result = $db->query("SELECT * FROM smf_boards WHERE name='One Piece'");
while($data = $result->fetch_assoc()) {
$id_board = $data['id_board'];
$results = $db->query("SELECT * FROM smf_messages WHERE id_board='$id_board'");
if($results){
while($row = $results->fetch_assoc()) {
echo $data['name'].' - <a href="../smf/index.php?topic='.$row['id_topic'].'">'.$row['subject'].$row['id_board'].'</a><br/>';
}
}
}

kode nya akan menampilkan topik/semua topik berdasarkan boards (ane ga tau namanya/ category kali yak.. 8)) "One Piece"...

tp kayaknya lebih mudah kalau pake ssi, kalau manual spt ini kan harus menghubungkan dulu halaman ke database nya....

ada yg bisa bantu?? suwun tQ

Offline ryo12345

  • Semi-Newbie
  • *
  • Posts: 21
Re: Menampilkan Topik berdasarkan board/category di php
« Reply #1 on: October 11, 2014, 04:04:35 AM »
Kaga ngerti gan hahahaha sama sama newbie kita