how to put the content retrieved from database to a text fil
Posted: Wed Apr 08, 2009 4:29 pm
assume the below code working . How do i put the retrieved output into the text file (data.txt) .
Code: Select all
echo '<table border=0>';
echo '<tr>';
echo '<td>';
$test = mysql_num_rows($result);
if($test == 0)
{
echo 'empty';
}
$i=1;
echo '<dl>';
while($row=mysql_fetch_array($result))
{
$test = $row["category_name"];
//echo $id;
echo '<dt>',$i++," ",$row["category_name"],'</dt>';
$subc = mysql_query("select topic_subject, category_name, circ_title from topic_tbl, category_tbl, circulation_tbl where topic_tbl.topic_id = category_tbl.topic_id and category_tbl.category_id = circulation_tbl.category_id and topic_tbl.topic_id = $data and category_tbl.category_name = '$test' ");
while($wow=mysql_fetch_array($subc))
{
echo '<dd>',$wow["circ_title"],'</dd>';
}
}
echo '</dl>';
echo '</td>';
echo '</tr>';
echo '</table>';