prepare($sql, array('integer'), MDB2_PREPARE_RESULT); $data = array($_REQUEST['poemid']); $results = $sth->execute($data); if(!MDB2::isError($results)) { /* Display Poem */ $rows = $results->fetchRow(MDB2_FETCHMODE_ASSOC); $smarty->assign('poem_title', $rows['title']); $smarty->assign('poem_id', $rows['poem_id']); $smarty->assign('poem_description', $rows['description']); $smarty->assign('poem_body', $rows['body']); $smarty->assign('poem_added', $rows['added']); $smarty->assign('poem_user_id', $rows['user_id']); $smarty->assign('poem_user_email', $rows['email']); $smarty->display('showpoem.tpl'); } else { /* Error */ } ?>