php - how to list all questions that has no answer in online discussion forum -


I am creating an online discussion forum in PHP as my final semester project and I list all those questions I do not answer the answer in the answer page, the stack is like the overflow.

But I do not know how to implement it; I search a lot on the internet but still I do not know how to list all the questions that do not have the answer.

Below is my code:

  & lt; php @session_start (); Included ("include / user_header.php"); Included ("include / connection.php"); $ Query = "SELECT *" is not in question, but does not exist here (Selection * Answer from Answer Q & A = Question = Question); " $ Result = mysql_query ($ query) or die (mysql_error ()); ? & Gt; & Lt; Script type = "text / javascript" & gt; If (action == "pass_id") {document.frm_cms.action = "answer.php"; & Lt; -! Document.frm_que.myaction.value = Action; - & gt; Document.frm_cms.id.value = ID; document.frm_cms.submit (); } & Lt; / Script & gt; & Lt; div class = "main container" & gt; & Lt; Div class = "second-main-container line" & gt; & Lt; Div class = "Ask-question-container" & gt; & Lt; Div class = "Ask-question-container-internal line" & gt; & Lt; form name = "frm_cms" method = "post" class = "printable" & gt; & Lt; Div class = "question-usr-preliminary line" & gt; & Lt; H1 class = "usr-hdng" & gt; & Lt; span class = "qustn-fgr-usr-prfl" & gt; & Lt; / Span & gt; Question & lt; / H1> & Lt; Ul class = "queue-to-query" & gt; & Lt ;? Php while ($ row = mysql_fetch_array ($ result)) {? & Gt; & Lt; li class = "row" & gt; & Lt; A href = "javascript: setAction ('pass_id', '& lt ;? php echo $ line [' question_id '];; & gt;');" & Gt; & Lt ;? Php echo $ row ['title']; ? & Gt; & Lt; / A & gt; & Lt; Div class = "search-tag-cnt ray" & gt; & Lt ;? Php $ tgNm = Explosion (",", $ line ['tag_name']); For ($ k = 0; $ k & lt; Count ($ tgNm); $ k ++) {$ k + 1; ? & Gt; & Lt; a href = 'question.php? Id = & lt ;? Php echo $ tgNm [$ k]; ? & Gt; '& Gt; & Lt ;? Php echo getFromId ("tag", "tag_name", "id", $ tgNm [$ k]); ? & Gt; & Lt; / A & gt; & Lt ;? Php}? & Gt; & Lt; / Div & gt; & Lt ;! - / search-tag-CNTR - & gt; & Lt; / li & gt; & Lt ;? Php}? & Gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt ;! - / question- usr-prfl - & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? Includes php ("include / user_footer.php"); ? & Gt;    

I think that something like this is worth trying: < Select pre> select question. Answer the question but leave the answer (question.id = answer.question_id) where answer.id IS Null

I have left in the answer table (since we want it to be unsuccessful Go) and then compare NULL with a non-empty column such lines that come back are questions that do not have the answers.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -