How to get the filename to download?
Posted: Tue Mar 11, 2014 4:28 am
How to get the filename from MySQL to download file? Thanks!
Code: Select all
$filepath = "C:/upload";
$sql = "SELECT date_format(uploaddate,'%c/%e/%y') as formatted_date, topic, filename from upload order by uploaddate desc";
$result = mysql_query($sql);
while($row = mysql_fetch_row($result))
{
echo "$row[0],$row[1],<a href=\"upload/$row[2]\">(Download)</a><br><br>";
}