hi, i am having trouble printing the records form my database. each row has a topic and headline. the topic should print and then the headlines for that topic, then the next topic and headlines.
healthcare
headline1
headline2
sports
headline3
headline4
headline5...
$result = mysql_query("SE LECT * FROM mccnews, topics where mccnews.topicid = topics.topicid ",$connect) ;
while($myrow = mysql_fetch_arr ay($result))
{//begin of loop
$name = $myrow['name'];
$hklink = $myrow['hklink'];
$headline = $myrow['headline'];
$first_headline = $headline;
// build $content table
$content .= table_header();
$content .= "<tr>";
$content .= "<td>" . $name . "</td>";
$content .= "<td>" . $hklink . "</td>";
$content .= "<td>" . $headline . "</td>";
$content .= "</tr>";
$sontent .= table_footer;
}//end of loop
healthcare
headline1
headline2
sports
headline3
headline4
headline5...
$result = mysql_query("SE LECT * FROM mccnews, topics where mccnews.topicid = topics.topicid ",$connect) ;
while($myrow = mysql_fetch_arr ay($result))
{//begin of loop
$name = $myrow['name'];
$hklink = $myrow['hklink'];
$headline = $myrow['headline'];
$first_headline = $headline;
// build $content table
$content .= table_header();
$content .= "<tr>";
$content .= "<td>" . $name . "</td>";
$content .= "<td>" . $hklink . "</td>";
$content .= "<td>" . $headline . "</td>";
$content .= "</tr>";
$sontent .= table_footer;
}//end of loop
Comment