I've got a layout problem when I have a while loop that will display a list of database entries.
The info is within a div but the output seems to be overlay'd on top of the div instead of inside the div.
The only thing that will I can do to make it look right is to add like 10 to 15 line breaks after the while loop. The number of line breaks needed will change depending on how many results are displayed so I don't want to just add line breaks.
Any ideas how to fix it? Check out the pictures and tell me what you think (the first screen shot it the bad one and the second is how it needs to look (I added line breaks).
Thank you. Let me know if you need any source code.
A link to the site where we can see the actual output would help. And the code you're using would be quite helpful too. All we can do this way is take wild guesses.
<?php
require_once ('../includes/header.php');
include ('../includes/config.inc.php');
require_once ('../../../Connections/dbc.php'); // Connect to the db.
if (!isset($_SESSION['user_name'])) {
echo '<p><font color="#FF0000">You must be logged in to view this page.</font></p><br /><br /><br /><br />
<p><a href="login.php">login</a></p><br /><br />';
include ('../includes/footer.php');
exit();
}else{
// Make the query.
$query = "SELECT id, headline, news, DATE_FORMAT(date, '%m/%d/%Y') AS date FROM news ORDER BY DATE_FORMAT(date, '%Y %m %d') DESC";
$result = @mysql_query ($query); // Run the query.
$num = mysql_num_rows($result);
if ($num > 0) { // If it ran OK, display the records.
?>
<br />
<?php
mysql_free_result ($result); // Free up the resources.
} else { // If it did not run OK.
echo '<p><span class="reg">There are currently no news updates.</span></p>
<p><a href="add_news.php">+ <u>add news</u></a></p>';
}