I have this Upload script that works fine for uploading files into the MySQL database...Now there is a public page where these files can be available for download, - what Im trying to do is get the file id to display and the file name and have it linked to the file so users can click on it and download the file...However the only thing that seems to be showing is a blank white page. - Any advice?
<?php
// Connects to your Database
mysql_connect("**", "***", "***") or die(mysql_error());
mysql_select_db("legion") or die(mysql_error());
$query = "SELECT id, name FROM uploads";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
{
echo "Database is empty <br>";
}
else
{
while(list($id, $filename) = mysql_fetch_array($result))
{
?>
<a href="download.php?id=<?php=$id;?>"><?php=$filename;?></a> <br>
<?php close();
?>
MySQL Fetch Array Linking
Moderator: General Moderators
Re: MySQL Fetch Array Linking
Unless short tags are enabled in your server, you will have to use <?php echo