Prova così:
Codice PHP:
<?php
$DB_host = XXXXXX;
$DB_user = ''abcd;
$DB_password = 'fgh';
$DB_name = 'mno';
$link = mysql_connect($DB_host, $DB_user, $DB_password);
if (!$link) {
die ('Non riesco a connettermi: ' . mysql_error());
}
$db_selected = mysql_select_db($DB_name, $link);
if (!$db_selected) {
die ("Errore nella selezione del database: " . mysql_error());
}
$result = "SELECT COMMENTO FROM pensieridelgiorno where
MONTH(DATA) = MONTH(CURRENT_DATE) AND
DAY(DATA) = DAY(CURRENT_DATE)";
$risultato= mysql_query($result)";
$destinazione = fopen("tmp/valore.txt","w");
fwrite($destinazione, $risultato);
fclose($destinazione);
mysql_close()
?>