I'm including 2 seperate sql scripts into one page, if I call both the first one include()'d is executed the second is not, but there is no error. I checked out the manual over at php.net and I'm wondering if something isn't being buffered correctly perhaps. Here's the 2 scripts. Pretty simplistic.
function blog()
{
$db_link1 = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db(contentmanagement, $db_link1) or die(mysql_error());
$query1 = mysql_query("select * from blog order by id DESC limit 10") or die(mysql_error());
while ($dbrow1 = mysql_fetch_array($query1) or die(mysql_error()))
{
echo "$dbrow1[date]<br>";
echo "$dbrow1[title]     ";
echo "<div class = line_seperator>";
echo "</div>";
}
mysql_close($db_link1);
}
blog();
function news() {
$dbuser = root;
$dbpass = mysqlr00t;
$dbhost = localhost;
$db_link = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db(contentmanagement, $db_link) or die(mysql_error());
$query = mysql_query("select * from news order by id DESC limit 5") or die(mysql_error());
//printf("Blog entries found: %d\n", mysql_affected_rows());
while ($dbrow = mysql_fetch_array($query) or die(mysql_error()))
{
echo "<div id=story1>";
echo "<div class = center>";
echo "$dbrow[title]     ";
echo "$dbrow[date]<br><br>";
echo "</div>";
/ echo "By: $dbrow[byline]<br><br>"; /
echo "$dbrow[data]<br><br>";
echo "<div class = line_seperator>";
echo "</div></div>";
}
}
news();
If I call blog function before news, news never gets executed and vice versa. I'm scratching my head over this one, been working on it for a couple hours now, need a second set of eyes =)
Here's a snip of the calling page.
include("menus/main.html");
echo "<br>";
<blog should be called here>
echo "</div>";
<news should be called here>
echo "</body>";