<?
for ($i=0; $i < count($body_array); $i++)
{
if ($news_array[$i] != "(Archive)")
{/*
Echo "URL: <a href=\"http://". $href_array[$i] . " </a> <br>" . "News Source: " . $news_array[$i] . "<br>" .
"Body: " . $body_array[$i] . "<br>" .
"Date: " . $date_array[$i] . "<br>" .
"<hr>";*/
fwrite ($news_file, "<tr>");
fwrite($news_file, "<td bgcolor=\"#F1F1EB\"><font face=\"Arial, Helvetica, sans-serif\">\n");
fwrite ($news_file, "<a href=\"http://". $href_array[$i] . " </a></td>\n");
fwrite ($news_file, "<td><i>" . $news_array[$i] . "</i></td>\n");
fwrite ($news_file, "</tr>\n");
fwrite ($news_file, "<tr bgcolor=\"#E1DFCC\">\n");
fwrite ($news_file, "<td colspan=\"2\"><font face=\"Arial, Helvetica, sans-serif\"><font color=\"#000000\"> $body_array[$i]</font></font></td>\n");
fwrite ($news_file, "</tr>\n");
fwrite ($news_file, "<tr bgcolor=\"#D7D8B8\">\n");
fwrite ($news_file, "<td colspan=\"2\"><font face=\"Arial, Helvetica, sans-serif\"><font color=\"#999999\">" .$date_array[$i] . "</font></font></td>\n");
fwrite ($news_file, "</tr>\n");
fwrite ($news_file, "<tr bgcolor=\"#FFFFFF\">\n");
fwrite ($news_file, "<tr><td colspan=\"2\"><form>Delete:<input type = checkbox name=test> <select name=country[]>
<? for (\$j = 1; \$rowcoun = mysql_fetch_row(\$result_country_test); ++\$j)
{
echo \"<option>\$rowcoun[0]</option>\";
}
echo \"</select></form></td></tr>\"; ?>");
fwrite ($news_file, "<td colspan=\"2\"> </td>\n");
}
else
{
echo "ARCHIVE NOT SHOWN";
}
}
?>
Okay, I admit , this is pretty jumbled code....and before anyone says anything, yes, i know I don't need all those multiple fwrites.
That being said, this code semi-works. Basically I have a bunch of news stories, i split them up into different parts (source, headline, body, date) and then with each seperate story, i am trying to read countries from a database i have and have a drop down select box for each news story, where someone will be able to assign a country to a story. The above code works, but will only print out the FILLED drop down select box for the first story. So say I have 20 stories, it will only print out a filled drop down for the 1st story, and the 19 other stories will have blank drop downs. Is there some way I can fix this?