-say you are making a fake site(for learning), an online cd/vinyl store with around 50 cds.
-you have made 50 html pages, one for each album.
-you have a database in access with one field that has the appropriate link to the html page for each and every record and the same for the soundclips. i.e
"artist | title | sound | link|
blah, blah, blah.mp3, 10.html
now you attempt to make a search + resluts page with asp.
how the hell exactly do i get the sound(speaker) buttons and the details(magnify) buttons next to each item to dynamically link to the correct html page and soundclip? is there any simple way of doing this?
allida77
07-18-2002, 01:35 PM
All of this information should be stored in your database. I do not understand why you would code 50 pages if you are going to use a db and ASP. Do the link names have the artist name in them? If they do you can do something like
<%
While Not rs.EOF
If InStr(rs("link") ,"Artist") <> 0 Then
Response.Write(rs("link"))
End If
rs.MoveNext
Wend
%>
That will probaly not be accurate all the time because the field link is in no way connected to the hard coded html pages.
ecnarongi
07-19-2002, 06:34 PM
did allida77 answer your question??
sorry, all a little over my head, :o the links to all the html pages are like 01.html, 02.ht.. etc...
allida77
07-22-2002, 04:38 PM
There is no way to do this in a simple way. You are going to have to hard code every single link and you will not need asp or a db. If you added a field in your db called aritst then it would make this very easy.
well i do have a feild in the DB called "artist" that is where the artist's names are stored, but the links do not have the artists name in them...
i know this is an unrealistic way of doing things but i am very new to this and by the time i would have learnt how to make that one "more details.asp" page it would be too late i had to learn how to do all the rest so i decided just for this first time as just for the purpose of having work to stay up and make all of those individual html pages, now i would like to use them.
(this is fake but still a project for design college, i have already handed it in but i can redo, it's just they are focusing mostly on
the design side as opposed to the scripting-backend side of things so i am pretty much on my own doing this)
perhaps i could now make one asp page? but that would mean i have to make heaps of tables , one for each and every album that contains the tracklisting, also for the soundclips and album covers right? this would take even more time, not to mention it would perhaps also be over my head getting it all to work.....
whammy
07-25-2002, 12:11 AM
Like allida said, you'd be much better off doing all of this with a database (or more likely a set of related databases), and making perhaps ONE page to do all the work for you.
This kind of information/reporting, etc. is what relational databases are DESIGNED to do for you.
If you're completely new to databases, I'd check out webmonkey.com's relational database tutorial, that should get you started!
Believe me, in the long run you'll be VERY glad you did, since you don't have all of those hard-coded pages to potentially have to edit... my advice - throw all of your ".html" pages in your virtual "File 13", and create everything dynamically on the fly from your database(s)... using 1 or a few dynamic .asp pages... it's MUCH much easier - and not as hard as you might think. If I can do it, so can you...
If you only have 50 cd's, I'd probably just use one database, and have a field for the CD "ID" (Probably the Primary Key), Title, Artist, Tracks, Description, Credits, Images (in a delimited string probably), and a field with the sound files stored in a delimited string or something...
Then depending on the CD someone picked, you'd just pass that "CD_ID" in a querystring and write all this stuff to the page depending on what's in the database for that "CD_ID".
You could split the stuff stored in a delimited string up into an array (or just scratch that idea, and use a related database, if you want to do it that way for learning purposes!) and bam!, you have all of your images, sound files, etc. ready to dynamically write to the page.
This sounds hard if you've never done it... but it's not, really.:
http://hotwired.lycos.com/webmonkey/backend/databases/
:)
thanks for the all the info :)
<CF OUTPUT QUERY>
<a href="#link#"><img src="more_details_pic"></a>
</CF OUTPUT>
yup i'm gonna go with CF on this one :thumbsup: