Reply
Do I use a database for this?
Old 01-12-2008, 06:16 PM Do I use a database for this?
Junior Talker

Posts: 2
Name: nick
Hi, I have a couple OScommerce sites so I am by no means a webmaster

However I am looking into expanding into a downloadable library for my customers, Theres about 2500 files though! Obviously It would take MONTHS to make individual HTML links to them and create a page like that, there must be a easy way, I do not know much at ALL about databases so I assume this is what people use for this task? My Host does have MYSQL...

Let me give you an example of a page that might give you an understanding of what I need. On this guys page you can see he has a nice list of games or whatever, I want the same type setup only for my ebook manuals, I doubt he sat there and typed all those in individually right? Heres the page example http://doperoms.com/roms/32x.html

Thanks for your response and taking the time for a new guy.
mrserv0n is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-12-2008, 11:14 PM Re: Do I use a database for this?
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 804
Name: Jeremy Miller
Location: Reno, NV
I'd recommend using a database for this. Since you have this stuff already somewhere, you'll want to write a script to automatically insert that information into the database and then edit the information as needed.
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-13-2008, 12:34 PM Re: Do I use a database for this?
chrishirst's Avatar
Super Moderator

Posts: 11,441
Location: Blackpool. UK
Quote:
I do not know much at ALL about databases so I assume this is what people use for this task
Yep, but the database is only ONE part of the process, you also need server side code to query the database and display the information in HTML code.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-13-2008, 03:42 PM Re: Do I use a database for this?
maxxximus's Avatar
Extreme Talker

Posts: 166
Name: Rob
Location: UK
A simple scandir script would suffice. http://uk3.php.net/scandir

Something like below - will scan a specific directory and print out each file as a link.

PHP Code:
 <?php 
function listDirectory ($dir){
$list scandir($dir);
$i 0;
$num count($list);
while(
$i $num){
print 
"<a href=\"$dir/$list[$i]\">$list[$i]</a><br />";
$i++;
}
}

echo 
listDirectory("images");// substitute images for the directory to list
?>
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 04:04 PM Re: Do I use a database for this?
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 804
Name: Jeremy Miller
Location: Reno, NV
maxximus's code is for PHP 5 only, so if you're working on PHP 4...well, upgrade to PHP 5!
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-13-2008, 09:04 PM Re: Do I use a database for this?
Junior Talker

Posts: 2
Name: nick
maxximus, thanks a ton, that is awesome! when I get a moment I will play with it and let you know

Last edited by mrserv0n : 01-13-2008 at 09:09 PM.
mrserv0n is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Do I use a database for this?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14293 seconds with 13 queries