Cache results of a mysql query manually to a txt file

Matt002

New Member
Is there a way to cache results of a mysql query manually to a txt file?Ex:\[code\]$a=1;$b=9;$c=0;$cache_filename = 'cached_results/'.md5("$a,$b,$c").'.txt';if(!file_exists($cache_filename)){ $result = mysql_query("SELECT * FROM abc,def WHERE a=$a AND b=$b AND c=$c"); while($row = mysql_fetch_array($result)){ echo $row['name']; } // Write results on $row to the txt file for re-use}else{ // Load results just like $row = mysql_fetch_array($result); from the txt file}\[/code\]The original query contains more WHEREs and joins that uses multiple tables.So, Is this possible? If so, please explain.Thank you,pnm123
 
Back
Top