Forum Moderators: coopster
for a trial I made a simple DB table 1 row one col
my index position all page segments fine but one
that is pulled from the DB
instead of placing the small test text it show a " 1 "
(query result) where the text should be and palce the text out of page table to its very top left corner
here is what I use
<<<
from the index:
$content .= include "includes/main_content.inc.php";
$page->SetParameter("PAGE_CONTENT", $content);
from the main template"
<td width="610" valign="top"><br></br><!--{PAGE_CONTENT}--></td>
the whole main content .inc main_content.inc.php
<?
$conn = db_connect();
$sql= "select main_content from test";
//where id=$id";
$result = mysql_query($sql,$conn);
while ($new_content=mysql_fetch_array($result) ){
print $new_content[main_content];
}
?>
>>> Any input? obviously there is a query problem but I cannot zero on it
thanks
Henry
you should do:
$content = '';
include "includes/main_content.inc.php";
$page->SetParameter("PAGE_CONTENT", $content);
and this is your include:
<?
$conn = db_connect();
$sql= "select main_content from test";
//where id=$id";
$result = mysql_query($sql,$conn);
while ($new_content=mysql_fetch_array($result) ){
$content .= $new_content[main_content];
}