'black'
,'face' => 'Arial'
,'size' => '1'
));
$font->add("This text is in Arial, Size 1
");
return($font->generate());
}
function add_to_cache($dbname, $id_link) {
$name = 'font01';
$value = make_html();
$str_sql = "
INSERT INTO html_cache
(name,value)
VALUES ('$name','$value')
";
$result =
mysql_db_query($dbname, $str_sql, $id_link);
if (! $result) {
affy_error_exit('Unable to Insert');
}
return($value);
}
function test_cache($dbname, $id_link) {
$name = 'font01';
$str_sql = "
SELECT value
FROM html_cache
WHERE name = '$name'
";
$result =
mysql_db_query($dbname, $str_sql, $id_link);
if (! $result) {
echo "Generating HTML
";
$value = add_to_cache($dbname, $id_link);
}
else {
echo "From Cache
";
$record = @mysql_fetch_object($result);
$value = $record->value;
}
return($value);
}
$html = test_cache($dbname, $id_link);
echo $html;
@mysql_close($id_link);
?>