View Full Version : Include in Include giving problems

07-13-2005, 12:59 AM

this is the test.php code:

$result = mysql_query("SELECT * FROM news WHERE newsid='$newsid' ",$connect);

echo "<table width='440' border='0' cellspacing='0' cellpadding='0'>";

while($myrow = mysql_fetch_assoc($result))

echo "<tr>";
echo "<td colspan='4'><img src='images/arrow2.gif' width='26' height='26'><img src='images/tutheaders/news.gif' width='414' height='26'></td>";
echo "</tr>";
echo "<tr bgcolor='#F0F0F0'>";
echo "<td colspan='4'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='75' rowspan='2'><img src='images/news.gif' width='75' height='75'></td>";
echo "<td width='10' rowspan='2' valign='top' bgcolor='#FFFFFF' class='style'><div align='left'></div></td>";
echo "<td width='320' height='20' bgcolor='#FFFFFF' class='style2'><div align='left'>";

$txt1 = $myrow['title'];
$txt2 = $myrow['dtime'];
echo $txt1 . " (" . $txt2 . ")";

echo "</div></td>";
echo "<td width='10' rowspan='2' valign='middle' bgcolor='#FFFFFF'></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor='#FFFFFF' class='style1'>";

echo $myrow['text2'];

echo "</td>";
echo "</tr>";
echo "<tr bgcolor='#F0F0F0'>";
echo "<td colspan='4'></td>";
echo "</tr>";
echo "<tr bgcolor='#FFFFFF'>";
echo "<td colspan='4'></td>";
echo "</tr>";
echo "</table>";

And this is the index.php where the the test.php should include:

<td width="440" rowspan="17" valign="top"><table width="440" border="0" cellspacing="0" cellpadding="0">
<?php include("test.php") ?>
All the other includes work but this one doesn't, could be it that it has to do with the fact that test.php includes news_config.php?

If it does or if it doesn't can anyone help me out with this? Thank you

07-13-2005, 01:25 AM
What doesn't work on it? The query? Nothing printed out at all?

07-13-2005, 02:19 AM
Oh sorry, it doesnt display the test.php include and whole my tables are messed up...

SeeIT Solutions
07-13-2005, 02:30 AM
The only thing wrong above that I saw was you are missing a semi-colon where you include test.php

Are all the paths to the includes correct?

07-13-2005, 01:35 PM
Yep everything is correct, sorry for asking but do you have msn or something so i can show you?

07-13-2005, 03:46 PM
There shouldn't be a problem nesting includes, I do it all the time. Where is $connect set in the test.php script, is it inside news_config.php?

Maybe try putting an echo statement inside news_config.php and see if it echoes when you browse to index.php, if it does then the include is there at least. Also, maybe try setting error_reporting(E_ALL); and see if it's telling you about some error that might otherwise be surpressed.

07-13-2005, 04:56 PM
Ok I'll try that when i'm home.