tags:

views:

17

answers:

0

Hello all i have createde a forum where i get the name of the user who createde the topic and what user who write the last topic but somehow its order by fk_forum_traad and not the ID.

Here is my code

   $kategoriID = $_GET['kategoriID'];
$mysql = connect();
$stmt = $mysql->prepare("
Select
t.dato,
t.brugernavn,
t.fk_forum_kategori,
t.indhold,
t.overskrift,
t.id,
k.id,
k.fk_forum_traad,
k.brugernavn, 
k.dato
FROM
forum_traad t INNER JOIN
forum_kommentare k ON k.fk_forum_traad = t.id
WHERE
k.godkendt = 'ja'
AND
t.fk_forum_kategori = ? GROUP BY t.id ORDER BY k.id ASC")or die($mysql->error);


 $stmt->bind_param("i", $kategoriID);

Thanks for the help :)