Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Need Help With My Database [resolved]


6 replies to this topic

#1 oxida

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 51 posts
  • Gender:Male
  • Location:Netherlands
  • Interests:cosmology, hi-tech, photoshop, php, webdesign, graphic design, downhill biking, swimming, coastguard.

Posted 22 July 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

#2 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 22 July 2008 - 02:05 PM

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.

#3 asglu

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 12 posts

Posted 22 July 2008 - 02:35 PM

View Postoxida, on Jul 22 2008, 01:46 PM, said:

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

<?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

#4 oxida

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 51 posts
  • Gender:Male
  • Location:Netherlands
  • Interests:cosmology, hi-tech, photoshop, php, webdesign, graphic design, downhill biking, swimming, coastguard.

Posted 24 July 2008 - 04:20 PM

@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.

#5 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 24 July 2008 - 07:39 PM

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.

#6 oxida

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 51 posts
  • Gender:Male
  • Location:Netherlands
  • Interests:cosmology, hi-tech, photoshop, php, webdesign, graphic design, downhill biking, swimming, coastguard.

Posted 25 July 2008 - 10:28 AM

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*

#7 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 25 July 2008 - 01:35 PM

Topic is resolved.

Please PM any moderator to continue this discussion. Until then, this topic is closed.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users