Jump to content

ARRRRRGGGGHHHH!!! PHP SQL and Includes


empireempire

Recommended Posts

The problem: Included html file (navigation) is appearing [i]within[/i] the <div> of another block for no apparent reason. however it stops when i delete the SQL call to the db, and more specifically the echo ing of rows (see ***)


PHP:

<body bgcolor="#666666">
<div id="pagecontainer"></div>
<div id="news">
<?php
// connect to server, database, table.
include ("http://www.empireempire.org/includes/db_connect.inc");
$sql = mysql_query("SELECT * FROM sitenews");

while ($row = mysql_fetch_row($sql)) {
echo "$row[0] $row[1] $row[2]" ; <------------ PROBLEM HERE??? **** WORKS WHEN DELETED
} ?>
</div>
<div id="buttons">
<?php include ("http://www.empireempire.org/includes/homebuttons.html"); ?>
</div>

<div id="footer"><? include ("http://www.empireempire.org/includes/footer.html"); ?>
</div>

</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/10242-arrrrrgggghhhh-php-sql-and-includes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.