Jump to content

Download file from Mysql


RidgeandGable

Recommended Posts

cheers got it working 

<table border="3">
         <tr>
           <td>id</td>
           <td>username</td>
           <td>datebooked</td>
           <td>timebooked</td>
           <td>notes</td>
         </tr>
         <?php do { ?>
           <tr>
             <td><?php echo $row['id']; ?></td>
             <td><?php echo $row['username']; ?></td>
             <td><?php echo $row['datebooked']; ?></td>
             <td><?php echo $row['timebooked']; ?></td>
             <td><?php echo $row['notes']; ?></td>
           </tr>
           <?php } while ($row = mysql_fetch_assoc($Recordset1)); ?>
</table>

Just looking how to add colour change :) Slowly winning

Link to comment
Share on other sites

lol I figure it out. My head is banging, but big improvements on site now tho http://scotair.noip.me I have left the test username on so User - alex & password alex :D

 

I did want to ask one quick question but feel free to tell me where to go lol

Would this code take much to alter and instead of going to download, display the files by a centre size on page? Reason I ask is because that little bit of code you done works so well, it would also make an ideal little pic gallery allowing me to upload etc by username?

 

echo '<h2>Customer Invoices</h2>';

// get the files belonging to the logged in user
$result = mysql_query('SELECT upid, name, size FROM upload WHERE username=\''.mysql_real_escape_string($_SESSION['MM_Username']).'\'');

// check query did execute without errors
if($result)
{
    // output each file
    while($row = mysql_fetch_assoc($result))
    {
       echo '<a href="download1.php?upid='.$row['upid'].'">'.$row['name'].'</a><br />';
    }
// query did not execute, log or show error message
} else {
    trigger_error('Cannot get users files from database: ' . mysql_error());
}
?>

instead of tbl upload it would be table gallery?

Link to comment
Share on other sites

No. Don't. Just google - php gallery tutorial, find some decent one and pick it up. I am not trolling or being glib, but you are not a guy who is trying to learn into the good programming habits :happy-04:

 

BTW: thanks for the beer mate :)

Edited by jazzman1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.