简体   繁体   中英

My blog.php file in my admin section is not showing all of the posts in the database

I have a php file in the admin section of a website I built. The file pulls posts from a certain database and corresponding table spits them out onto the page with a Edit button link to edit that specific post. All of this is working properly. However at the moment the database says there are 15 entrys in the table, yet only 12 are viewable on screen to click and edit. Please let me know what else I can include to help me solve my problem? Thanks in advanced.

Blog.php file

<?php
    include("../mysqlConnect.php");
    include("header.php");

    $results = mysql_query("SELECT *  FROM blog ");
?>
<?php include("adminNav.php");?>


     <div id="logout">
        <a href="http://mrskitson.ca">view changes</a>
     </div>



     <div class="span-16" id="learning">

     <?php
        while($row = mysql_fetch_array($results)){
        $title = $row['title'];
        $date = $row['date'];
        $image = $row['image'];
        $content = stripslashes($row['content']);
        $id = $row['id'];


        echo "<div class='span-16' id='posts'>";
        echo "<h1>$title </h1>";
        echo "<h2>$date</h2>";
        echo "<img src='../images/blog/$image'>";
        echo "<p>$content</p>";
        echo "<a class='editPost' href=blogEdit.php?id=$id>Edit This Post</a>";
        echo "</div>";
        }
     ?>
     </div>


<?php
 include("footer.php");
?>

The code seems to run to all the records store in the table "blog". I can think of three things you are pulling data from the wrong table, looking at the wrong table on phpMyAdmin or in your CSS the id "learning" has defined a height and overflow and is hiding the other records.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM