PDA

View Full Version : db script changing location of content



tinab
08 Oct 2009, 11:23 AM
Hello!
I am both a new user to this site, and very new to web design. I am working in marketing for a startup software company and after complaining about how the site looked, was given the task of creating a new one. I have VERY little experience with this, so a few things don't make sense to me. If anyone can shed some light it would be greatly appreciated.

I currently have a "recent news" section in my index page that is linked to the database where I input the most recent news items. I have db script in two places. I was instructed by network solutions to put the first piece in between the head and the body:

<?php
require_once("pcs_tools.inc.php");
require_once("tools/db.inc.php");
$db = new DB("pcs_db");
?>

and the second piece in the section of my code where the column for recent news is:

<?php
$db->sql = "SELECT * FROM news ORDER BY date DESC LIMIT 1";
$db->go_sql();
while ($row=$db->get_row()) {
printf("<p align=\"left\"><span style=\"color:#cc0000\">$row[date]</span> ");
printf("<strong>$row[banner]</strong>. \n");
printf("$row[synopsis]");
printf("</p>");
printf("<p>&nbsp;</p>\n");
}

?>

It is in fact working really well, except for the fact that this code seems to be affecting the entire page. I shifts the whole page down, in comparison to the rest of my pages. I have done some tests with this to ensure that it really is this specific code that is the root of the problem, and I'm sure of it! I just can't tell why, or how to fix it. Can anyone help?

Have a great morning!
Tina