如何添加新回复的帖子(主题),使其首先显示在顶部?

时间:2020-03-06 15:30:13

标签: php html multithreading forms

如何添加新回复的帖子(主题),使其首先显示在顶部?我有一个帖子主题列表,我需要显示主题,其中最先回复的是

这是我的重播代码

<?php
      $bro = $_GET['id'];
      $results_per_page = 5;
      $tablo = $trow['TTABLE'];
      $stmt = $db->query("SELECT COUNT(ID) AS total FROM $tablo");
      $page = $stmt->fetch();
      $total_pages = ceil($page["total"] / $results_per_page);
      ?> Pages: <?php for ($i=1; $i<=$total_pages; $i++) {  // print links for all pages
           echo "<a href='viewthread?page=".$i."&id=$bro'";
            if ($i==$page)  echo " class='curPage'";
            echo ">   ".$i."</a> "; 
}; 
                     if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
  $start_from = ($page-1) * $results_per_page;
                          ?>

                             <form id ="reply" action=''enctype="multipart/form-data"  method ="post">
                    <!--  <input type="text" class="disabled" value ="<?php //echo $prowx['MESSAGE'];?>  ">
                      <input type="text" class="hidden" value ="<?php// echo $prowx['NAME']; ?> "> -->
                     <div class="form-group">

                      <textarea id="editorxX" name="message"></textarea>
                <script>
                        ClassicEditor
                                .create( document.querySelector( '#editorxX' ) )
                                .then( editor => {
                                        console.log( editor );
                                } )
                                .catch( error => {
                                        console.error( error );
                                } );
                </script>
                    </div>

                      <div class="form-group">


 <input type="file" name="photo"  class="btn btn-light mr-2" placeholder="UPLOAD">  
 <br/> <br/>

 <button class="btn btn-light">Cancel</button>  <button type="submit" name="submit" class="btn btn-primary mr-2">REPLY THREAD</button>
                  </form>

                      </section> <!--2 -->
                  </div>
                       </div>

这是我的索引页面,其中将显示线程

<div id="Contact" class="tabcontent" style="border-bottom:2px solid white;">

<?php
$stmt = $db->query('SELECT ID,PNAME,PDESC,DATE,UPDATES,PEDATE,IMAGE,VIDEO,YOUTUBE,YOUCHECK,VIDCHECK,IMGCHECK,FUNDRAISERS,HOT,PROVISIONAL,SNAME,PRICE,STAGE FROM THREADS ORDER BY UPDATES DESC LIMIT 10');
while($trow2 = $stmt->fetch())

0 个答案:

没有答案