Jump to content
xisto Community
oxida

Need Help With My Database [resolved] retrive data as a link

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@jlhaslipi have the following tables:bands with the following rowsbandid, int(10), NOT NULL, AUTO_INCREMENT, PRIMARY KEYbandname, VARCHAR(30), NOT NULLbandsinfo with the following rows:infoid, int(10), NOT NULL, AUTO_INCREMENT, PRIMARY KEYbandinfo, VARCHAR(30), NOT NULLgenre, VARCHAR(30), NOT NULLbio, VARCHAR(30), NOT NULLGenre which is a dropdown box this isnt relevant.@AsgluThx I will try this.

Share this post


Link to post
Share on other sites

I would make that as one Table only and avoid breaking it into two tables.Add an album Table alb_idalb_namealb_release datealb_descriptionAnd 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 Tabletrack_idtrack_alb_id (link back to album)track_titletrack_descriptionSomething along those lines should work nicely for you.

Share this post


Link to post
Share on other sites

Thank you jlhaslipthis 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*

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.