Welcome Guest ( Log In | Register)



 
Closed TopicStart new topic
> Need Help With My Database [resolved], retrive data as a link
oxida
post Jul 22 2008, 01:46 PM
Post #1


Newbie [Level 3]
***

Group: [HOSTED]
Posts: 48
Joined: 12-June 08
From: Netherlands
Member No.: 63,541



This is the situation:

I have a database where you can add bands ( theire albums, genre other info)

For the album part they can add for each album the songs.


So what do i want:

When i show the results there only shoul display the bandname which should be a link to the more detailed info like albums biography etc.

How do I do that.

Is there a name for this and are there any tutorials.

thx in advance
Go to the top of the page
 
+Quote Post
jlhaslip
post Jul 22 2008, 02:05 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,001
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



What do you have for a Database design so far?
Without any coding or SQL information, it will be difficult to guess the changes you need to make.

I would use three tables. Band, Album, Songs.

Each band can have several Albums, and each Album can have a flexible number of Songs.
The Bio information can be placed into the Band Table.
Go to the top of the page
 
+Quote Post
asglu
post Jul 22 2008, 02:35 PM
Post #3


Newbie [Level 1]
*

Group: Members
Posts: 21
Joined: 6-April 08
Member No.: 60,456



QUOTE(oxida @ Jul 22 2008, 01:46 PM) *
This is the situation:

I have a database where you can add bands ( theire albums, genre other info)

For the album part they can add for each album the songs.
So what do i want:

When i show the results there only shoul display the bandname which should be a link to the more detailed info like albums biography etc.

How do I do that.

Is there a name for this and are there any tutorials.

thx in advance

easy thing here is an example

CODE
<?php
$db_host = "";///// put your host name
$db_user = "";///// put your database username
$db_pass = "";////// put your database passowrd if it is passworded
$db_name = "";///// put your database name
$dbc = mysql_connect($db_host, $db_user, $db_pass);///mysql connetion
$dbs = mysql_select_db($db_name);/seleting mysql db
$result = mysql_query("SELECT album,genre FROM mysql_table_name ORDER BY time ")or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "$row[0]  $row[1] ";
echo "------------<br />";
}
?>


Like this use multiple arrayed argument and use echo "<a href>..........,</a>"; to link it
Go to the top of the page
 
+Quote Post
oxida
post Jul 24 2008, 04:20 PM
Post #4


Newbie [Level 3]
***

Group: [HOSTED]
Posts: 48
Joined: 12-June 08
From: Netherlands
Member No.: 63,541



@jlhaslip

i have the following tables:

bands with the following rows

bandid, int(10), NOT NULL, AUTO_INCREMENT, PRIMARY KEY
bandname, VARCHAR(30), NOT NULL

bandsinfo with the following rows:

infoid, int(10), NOT NULL, AUTO_INCREMENT, PRIMARY KEY
bandinfo, VARCHAR(30), NOT NULL
genre, VARCHAR(30), NOT NULL
bio, VARCHAR(30), NOT NULL

Genre which is a dropdown box this isnt relevant.

@Asglu

Thx I will try this.
Go to the top of the page
 
+Quote Post
jlhaslip
post Jul 24 2008, 07:39 PM
Post #5


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,001
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



I would make that as one Table only and avoid breaking it into two tables.
Add an album Table

alb_id
alb_name
alb_release date
alb_description

And a track or song Table to add the tracks for each album. Keeping the tracks separate from the album allows for flexability in the number of tracks on the album.

track Table

track_id
track_alb_id (link back to album)
track_title
track_description

Something along those lines should work nicely for you.
Go to the top of the page
 
+Quote Post
oxida
post Jul 25 2008, 10:28 AM
Post #6


Newbie [Level 3]
***

Group: [HOSTED]
Posts: 48
Joined: 12-June 08
From: Netherlands
Member No.: 63,541



Thank you jlhaslip

this has brought me to use master/detail pages which will do the trick.

If i have the page finished i will try to make a tutorial.
Because I think it would help a lot of people.


*Problem solved*
Go to the top of the page
 
+Quote Post
jlhaslip
post Jul 25 2008, 01:35 PM
Post #7


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,001
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



Topic is resolved.

Please PM any moderator to continue this discussion. Until then, this topic is closed.
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Link To New Page?!(1)
  2. Putting In Videos With Dreamweaver(5)
  3. Import From Excel File Into Mysql Database(9)
  4. Guidelines For Building Web Sites(6)
  5. Simple Machine Forum Link Bbcode Help(5)
  6. How Do You Combine Multiple Mysql Databases Into One Database?(3)
  7. Help Or Advise Needed For Access Database Webpage Conversions(0)
  8. Merging Database Php Mysql(5)
  9. Help With Database(24)
  10. Giving A Flash Button A Link(3)
  11. Where Am I Going Wrong This Time?(4)
  12. Which Data Type To Use In Mysql Table(4)
  13. Another Question On Mysql Table Data Type(1)
  14. How Do I Add A Paypal Link On My Page?(2)
  15. Accessing Mysql From Javascript(4)
  1. Target Links To A Div Layer(22)
  2. Treating .csv Files As Database Data(2)
  3. Index In A Mysql Database(3)
  4. Dreamweaver Cs3: How To Link Content To Layers/apdivs(5)


 



- Lo-Fi Version Time is now: 7th September 2008 - 11:51 AM