Jump to content


Photo

making download.php help


  • Please log in to reply
1 reply to this topic

#1 ramram

ramram
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 October 2006 - 11:04 PM

I need help to set-up my MySQL database using php

I am trying to make a download.php which would let users to download files after 5 seconds.

The only problem is that my /download directory has many sub directory.

For example if someone wants to download FireFox, then firefox.exe is located in /download/FireFox/firefox.exe


and I want somewhat like this www.domain.com/download.php?fileid=firefox.exe as an output URL to download. I know that I can use MySQL and setup a nice database to do something like this as long as fileid is unique.


Any ideas on how to setup the MySQL database so that I can easily add multiple files from different sub directory at the same time.

Thanks for reading the topic. Have a good one.





#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 01 October 2006 - 11:09 PM

I guess in it's simplest format, you need a single table with three columns...

Downloads
fileID - (int) unique/auto-increment
fileName - (varchar)
filePath - (varchar)

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users