In dedecms, how do I call the questions and answers in the Q & A module? I want to call the questions and answers in the Q & A module, that is, display a question, then an answer, and how do I call it, I cannot use the SQL label. this is the label I wrote, but it cannot be used. I really cannot understand {dede: sqlsql = & quot; selectde_ask.id, how does dede_ask call the questions and answers in the Q & A module in dedecms?
I want to call the question and answer in the Q & A module, that is, to display a question and then an answer. how can I call it? I cannot use the SQL label to drop it. this is the label I wrote, but I cannot understand it.
{Dede: SQL = "select dede_ask.id, dede_ask.title, dede_askanswer.content from dede_ask left join dede_askanswer on dedede_ask.id = region where region = 1 and Region = 1 and Region = dede_askanswer.id order by de_ask.id desc LIMIT "}
Q: [field: title function = cn_substr (@ me, 52)/]
A: [field: content function = cn_substr (html2text (@ me), 48)/]... [details]
{Dede: SQL /}
------ Solution --------------------
#@__ Ask: Change it to your table name
{Dede: SQL = "select #@__ ask. id, #@__ ask. title, #@__ askanswer. content from #@__ ask left join #@__ askanswer on #@__ ask. id =#@__ askanswer. askid where #@__ askanswer. ifanswer = 1 and ##__ askanswer. ifcheck = 1 or #@__ ask. bestanswer =#@__ askanswer. id order by #@__ ask. id desc LIMIT 0, 1 "}
Q:[Field: title function = cn_substr (@ me, 46)/]
A:[Field: content function = cn_substr (html2text (@ me), 40)/],... details>
{/Dede: SQL}
------ Solution --------------------
Come to learn
------ Solution --------------------
Thanks for the solution provided by lijiancui.