PDO::ERRMODE_EXCEPTION )); }catch (Exception $e){ die("Error : ".$e->getMessage()); } if (isset($_GET['topic'])){ $topic_id = $_GET['topic']; $req = $db->prepare('SELECT topic_subject FROM topics WHERE id=:id'); $req->execute(array( "id"=>$topic_id )); if ($data = $req->fetch()) { $subject = $data['topic_subject']; } $req = $db->prepare('SELECT * FROM replies WHERE reply_topic=:id_topic'); $req->execute(array( "id_topic"=>$topic_id )); try { $rows = $req->fetchAll(PDO::FETCH_ASSOC); ?>

prepare('SELECT firstname, lastname, username FROM `authors` WHERE id=:user_id'); $req->execute(array( "user_id"=>$reply_by )); if ($data = $req->fetch()) { $username = $data['username']; $firstname = $data['firstname']; $lastname = $data['lastname']; } ?>
Author Reply Date
($username)"?> text($row['reply_content'])?>

Your Reply


getMessage()); echo "Can fetch topic data.\n"; } } else { $req = $db->prepare('SELECT * FROM `topics`'); $req->execute(); $rows = $req->fetchAll(PDO::FETCH_ASSOC); ?>

Topics

prepare('SELECT firstname, lastname, username FROM `authors` WHERE id=:user_id'); $req->execute(array( "user_id"=>$topic_by )); if ($data = $req->fetch()) { $username = $data['username']; $firstname = $data['firstname']; $lastname = $data['lastname']; } ?>
Subjects Answers Author Creation date