MySQL probs..
Posted: Thu Mar 06, 2003 6:55 pm
I've used eval() to get information from a specific page.
Works like a charm! The problem is... when I continue on in the SQL code later...
It writes the same information to a file over and over and over... 
http://www.empiregaming.net/xg/news/xgn.php (what the product is)
Any way to sort of reset the value of $template each time the while statement is run through?
Help is appreciated! Thanks!
Code: Select all
$filename = "/home/empirega/public_html/xg/news/xgn_template.txt";
$handle = fopen ($filename, "r");
$template = fread ($handle, filesize ($filename));
fclose ($handle);
eval("\$template = "$template";");Code: Select all
$fp = fopen("/home/empirega/public_html/xg/news/$site.php","w");
if($query) {
while ($data = mysql_fetch_assoc($query)) {
$subject = $data['subject'];
$author = $data['post_by'];
$body = $data['post_body'];
$date = date("l, F j Y \@ g:i a", $data['post_date']);
$news = $template;
fputs($fp,$news,strlen($news));
fflush($fp);
}
fclose($fp);
}http://www.empiregaming.net/xg/news/xgn.php (what the product is)
Any way to sort of reset the value of $template each time the while statement is run through?
Help is appreciated! Thanks!