<?php
$search = array('.pdf', '.', '-', '_');
$replace = array('', '/', '</u>- ', ' ');
$query="SELECT STR_TO_DATE(SUBSTR(`filename`, 1, 10),'%m.%d.%Y') as filedate, `filename`, `filepath`
FROM `files`
WHERE `filepath` LIKE 'sites/default/files/news/%'
ORDER BY filedate DESC
LIMIT 4";
$results = db_query($query);
while ($row = db_fetch_array($results)) {
echo '<tr>';
echo '<td><u><a href=http://website.com/sites/default/files/news/'. $row["filename"] . '>' . str_replace($search, $replace, $row["filename"]) . '</a></td><br />';
echo '</tr>';
}
?>
I have this code on the homepage of my website. It pulls all files in a certain folder that start with a date. Currently, when I add a new file, the query doesn't update, even though when I run the query in PHPmyadmin it works fine.
What's happening to make the query not update itself? Flushing cache's haven't worked for me.