Jump to content

Archived

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

empireempire

ARRRRRGGGGHHHH!!! PHP SQL and Includes

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>

Share this post


Link to post
Share on other sites
That's not a MySQL problem, that's a PHP problem... I assume that you can do variable interpolation, but maybe not with array references? Try doing a proper concatenation step.

Share this post


Link to post
Share on other sites

×

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.