cache the database result in txt file and how to output it?
<p>eg: <code>$results = mysql_query('SELECT title FROM article');</code> now I want to put the result in a text file. Then :</p>

<pre><code> $filepath = 'test.txt';
 if (is_file($filepath)) {
   echo file_get_contents($filepath);
 } else {
   // read the databse, and stored the result to the test.txt.
 }
</code></pre>

<ol>
<li>How to wirite the else part?</li>
<li>I want to echo the content in list style. how should I do? </li>
</ol>

<p>Thank you</p>
