|
|
|
|
![]() ![]() |
Jul 22 2008, 01:46 PM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 51 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 |
|
|
|
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: [MODERATOR] Posts: 4,300 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() myCENT:46.50 |
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. |
|
|
|
Jul 22 2008, 02:35 PM
Post
#3
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 12 Joined: 6-April 08 Member No.: 60,456 |
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 |
|
|
|
Jul 24 2008, 04:20 PM
Post
#4
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 51 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. |
|
|
|
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: [MODERATOR] Posts: 4,300 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() myCENT:46.50 |
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. |
|
|
|
Jul 25 2008, 10:28 AM
Post
#6
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 51 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* |
|
|
|
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: [MODERATOR] Posts: 4,300 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() myCENT:46.50 |
Topic is resolved.
Please PM any moderator to continue this discussion. Until then, this topic is closed. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 22nd November 2008 - 05:49 PM |