เมนู

แสดงโพสต์

ส่วนนี้ให้คุณดูโพสต์ทั้งหมดของสมาชิกท่านนี้ (เฉพาะโพสต์ในส่วนที่คุณมีสิทธิ์เข้าถึง)

เมนู แสดงโพสต์

ข้อความ - HowAreU

#1
ขอบคุณมากครับ แต่ข้างบนมันใช้ยังไง เหมือนจะใช้งานง่ายขึ้นเยอะเลย สุดยอด
#2
ct_count มาจากตางราง an_member  และ cat_name มาจากตาราง an_catalog โดยมีตัวเชื่อม ระหว่างสองตารางคือ cat_id เป็น fk อยู่ในตาราง member

select ct_count,cat_name FROM  an_member INNER JOIN an_catalog on an_member.cat_id = an_catalog.cat_id WHERE an_catalog.cat_name ='TEST';




ต้องการบวก ct_count  แล้วแสดงผลลัพท์ total_count กับ cat_name ต้องเขียนยังไงครับ  :P
#3
ได้แล้วครับขอบคุณครับ
#4
อยากให้แสดงข้อมูลจากตาราง ประมาณนี้ครับ สมมุตมีทั้งหมด 12record  พอครบ 6 record ให้แสดงต่อแถวใหม่ครับ




นี้โค้ดที่ลองทำครับ คือมันจะต่อ 1 2 3 4 5 6 7 8 9 10 11 12.... ไปเรื่อยๆในแถวเดียวจนครบ record
อยากให้แสดงผลตามรูปข้างบนต้องเขียนโค้ดยังไงดีครับ  :wanwan006:



         <table class="tg" width="100%">
                    <tr>
                        <th style="width: 17%"  class="tg-031e"></th>
                        <th style="width: 17%" class="tg-yw4l"></th>
                        <th style="width: 17%" class="tg-yw4l"></th>
                        <th style="width: 17%"  class="tg-yw4l"></th>
                        <th style="width: 17%" class="tg-yw4l"></th>
                        <th style="width: 17%" class="tg-yw4l"></th>
                    </tr>

                    <tr>

                        <?php
                        while ( 
$result mysqli_fetch_array($CHRow ) ) {
                        ?>

                        <td class="tg-yw4l">
                            <div class="box">   
                                <h4 class="title"><?php echo $result['cat_name']  ?></h4>
                            </div>
                        </td>
                        <?php
                        }
?>


                    </tr>



                </table>
#6
หน้านี้ รับค่าจากการคลิก form จากหน้าที่แล้วมาแสดงเนื้อหา

แต่ทีนี้พอหน้านี้แสดงผลแล้ว ไปต่อไม่ได้ เพราะต้องรับค่าจาก form หน้าที่แล้ว
เลยอยากให้หน้านี้ มี form ส่งค่าและ รีโหลดใหม่โดยใช่ค่าจากหน้านี้แสดลผลจะได้ไหมครับ
:P

<?php if(isset($_GET['page']) && (isset($_POST['catalog_n']))) {
$G_Page =$_GET['page'];
$G_Cat =$_POST['catalog_n'];
$G_Chapter $_POST['chapter_n'];
           

                 if(
$G_Chapter $getmaxchapter){
                $TEXT1 "หน้าหน้าถัดไป";
                $G_Chapter+=1;
                echo $G_Chapter;
                }
                else
                {
                $G_Chapter-=1;
                $TEXT1 "ก่อนหน้า";
                echo $TEXT1.$G_Chapter;
                }
                

}
?>





ตรงนี้จะส่งค่าไปที่ไหนยังไงดีแล้วให้โหลดแสดงผลหน้าเดิมโดยใช้ตัวแปรจากด้านบนรับค่ามาครับ


<form id="form1" method="post" action="<?php echo "chapterpage.php?page=".$G_Cat." ".$G_Chapter?>" >
                        <input  name ="catalog_n" id ="catalog_n" type="hidden"
                                value="<?$catalog_n = $G_Cat;?>"/>
                        <input  name ="chapter_n" id = "chapter_n" type="hidden"
                        value="<?$chapter_n= $G_Chapter;?>"/>
                        <p align="center"><input type="submit" class="btn btn-primary" value="<?php echo $TEXT1 ?>"></p>
                    </form>