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 entries in the table, yet only 12 are viewable on screen to click and edit.
Blog.php file
<?php
include("../mysqlConnect.php");
include("header.php");
$results开发者_StackOverflow中文版 = 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.
精彩评论