Nov 21, 2009

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

free web hosting
Open Discussion > MODERATED AREA > The Internet > Web Design

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

oxida
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

Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)

asglu
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

 

 

 


Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)

oxida
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*

Comment/Reply (w/o sign-up)

jlhaslip
Topic is resolved.

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

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : database, retrive, data, link

  1. Vb And Mysql
    connecting VB with mysql database (3)
  2. How To Use A Database For Chess Results?
    How to set-up, configure, and utilize a database to store chess result (0)
    Hi, I'm running a website for our chess club. Recently we decided to add a feature for members
    to simply enter their tourney results there but I do not exactly know how to do it. The first
    problem is how to create form for people to enter their game results. I just have an idea that
    working with drop down menus is faster, esaier and more precise than typing the information. The
    second problem is how to make these results search-able? Let me tell you the final problem which is
    the worst of all that is I do not know how to build a member area. Because Qupis does no....
  3. Dreamweaver Cs3: How To Link Content To Layers/apdivs
    (7)
    Hi all! I've been searching the internet like crazy but just can't find any answers to my
    problem. I want to make it so that my navigation buttons links content to be loaded inside a
    smaller layer/apDiv or perhaps something i've yet to discover. I just can't for my life
    understand how to do this nor what tools and options to use. I am using Dreamweaver CS3 in design
    mode and have no clue how to hard code in html, CSS etc.. Here's a picture of what i want to
    do. I really hope someone can help me or perhaps atleast point me in the right direction. ....
  4. Index In A Mysql Database
    Make the numbers follow (3)
    I hope I am on topic here (It does have to do with web design, after all). I have noticed that in a
    MySQL database, the 'id' field just keeps its numbers for every record, with the backdraw
    that, whenever you remove (a) record(s) from the table, you get your list numbered as eg.
    1,5,6,7,12,25 etc. This makes it a bit difficult of keeping track of the number of records in your
    table. Is there a way of achieving (either in PHPMyAdmin or through the use of PHP) that the id
    field in your table gets sort of 'refreshed and updated' so you have a clearer view....
  5. Treating .csv Files As Database Data
    Showing .CSV data on a web page (2)
    I use a nice program (which I helped to beta test) called ' Simfatic Forms ' to generate
    forms on web pages. The only problem is that it does not (yet) support MySQL databases, it saves the
    form data as a .CSV file. Now I was wondering if you can do the same with a .CSV file as you do
    with a MySQL databse, ie. displaying the data in that file on a web page which adjusts automatically
    as data are added to the file. To clarify: eg. if I make a form to sign a petition online, the data
    are saved to a .CSV file every time someone fills in the form, is it now possibl....
  6. Target Links To A Div Layer
    Is there such code that allows you to change ur link target so that it (22)
    Hey i need help I was wondering if there is a code that allows you to target ur link to a div
    layer.. lets say eg.. i got CODE Example i want that page to show in the div layer below
    on the same page. Is there a way i can do that? . im tryin to avoid using frames. thanks....
  7. Accessing Mysql From Javascript
    Javascript to communicate with database (5)
    I found a nice program which allows you to put quizzes on your web site. You can design your own
    questions, set the layout of your page, and there is also a possibility of having the results
    emailed to you. It further offers a facility to store the results and all that, all you have to do
    is put a link in the program, telling it which page takes care of that. However, when I look at the
    HTML code the program generates, I see that most of it is written in Javascript. Obviously, it also
    uses variable names, but as I don't know any Java, I was wondering if those variab....
  8. How Do I Add A Paypal Link On My Page?
    (2)
    For people to join my website (just friends at the mo) it is $10. I'd like to be able to create
    a paypal link on my page so that they have the option to pay via that? Thanks, std....
  9. Another Question On Mysql Table Data Type
    text field for lots of text. (1)
    In my MySQL table I would like to use one text field which can contain lots of text. What I want to
    use it for is for student records, and I want to be able to add to it without destroying what is
    already there. I want the field to contain something like: ****03/11/2007**** Chopin prelude No 9:
    small problem bars 12-15. Advice given on how to practice. ****10/11/2007**** Problem in Prelude
    overcome, piece successfully completed. New piece set: Beethoven Sonata No 1, movement 1. etc. This
    is of course just an example, but that is how I want to set up my student records....
  10. Which Data Type To Use In Mysql Table
    Using a 5 character number (4)
    If I wanted to use an ID field which automatically increments when data are addad, but displays the
    ID as a 5 figure number, which data type would I have to use? I would want a type that assigns a
    number to a record in the format "00001", "00002", etc. However, when I use "int" as datatype, it
    only displays th field contents as "1", "2" etc. So, which data type could do the job for me? i do
    not need a decimal point or anything, just an id that displays in 5 figures, including the leading
    zeros. Thanks in advance.....
  11. Where Am I Going Wrong This Time?
    Can't enter data into database (4)
    Hi, on my local machine (with Apache 2.0, PHP 5.2.4 and MySQL 5.0) I come across weird things. I
    have successfully made a table, but when I try to enter data into it it just will not accept the
    empty string for the first field (id). This was the creation line: QUOTE $query="CREATE TABLE
    members (id int(20) auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone
    varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT
    NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))"; This has crea....
  12. Giving A Flash Button A Link
    i get errors (15)
    oke well i made my button and i addet the actionscript to give the button an url,see the screenshot
    below now for some reason it gives me errors,and i don't know what i did wrong to be
    honest,so can some one help me out with this p.s i do use flash cs3 so i dunno maybe its another
    way to put an url on ur button with this version cause with flash pro8 and mx i never had a problem
    with this....
  13. Help With Database
    (24)
    I know I might sound a bit novice, but I'd like to know how to make a register and login
    database. I'm making a serious website for the very first time and I can't find on internet
    how to make one (don't even know how it is named). I would really appreciate me if someone could
    link me to a tutorial or give me the explanation, also the program to use (I think Microsoft Access
    is good?)....
  14. Merging Database Php Mysql
    (5)
    Hii i need help margning script. i have coppermine gallery, AzDGDating Site, Noah's
    Classifieds they all have user sign-up login. but they have different like i need to have 3 seperate
    account for each script is there any way like mergning one user name and password would work for 3
    section. if you don't get my question please tell me i will try to explain more in detail
    thank you for your time and help ....
  15. Help Or Advise Needed For Access Database Webpage Conversions
    I need some help with getting a linked webform so that the data can be (0)
    Hello All. I'm looking for some advise or assistance with getting a web page/access page
    running so that i can have the page online and collect the data live into my database for Project
    Management... Currently I'm developing a database using M$ Access, and need to have staff data
    enter sales information directly into a web form that can be linked to a database? I've looked
    at using a M$ Front page web form with data collected into a .CSV text file and extracting the data
    but i need to be able to let the staff review and update the data for each file? A....
  16. How Do You Combine Multiple Mysql Databases Into One Database?
    (3)
    How do you combine multiple mysql databases into one database? I was thinking thta soem servers
    restrict you to one to five mysql databases. If I have a dynamic part of a table on my site, I
    would use one database for that. For every table of dynamic information, I use one database. Can I
    streamline what I am doing and combine all of my databases into one? I could make multipple tables
    in the same database. Would that work? thanks....
  17. Simple Machine Forum Link Bbcode Help
    I linked some of my word in the topic but... (5)
    I am in trouble , in a lot of topics I typed a link lead to another site with the right format
    but when I click on the , it change to a blank page , what 's wrong ? If I just put the mouse
    over the word I linked , it says at the bottom left of Internet Explorer http://mysite.com/forum
    and then I click it , a blank white page showed up. What should I do now. I putted a Link in the
    NEWS but it goes to the same problem. Thank you very much. Topic title modified. Topic moved. ....
  18. Guidelines For Building Web Sites
    A tutorial Link from Astahost (6)
    I was cruising through the Astahost Forum this morning and found this really good bit of information
    about guidelines for Site Design and thought I'd share it with all the fine folks here at the
    Trap. None of these suggestions are "required" for your sites, but they are highly reccomended
    suggestions about designing for the web. If you read this forum, read the whole thing, because the
    replies add to the original topic post and all are valid points. Enjoy. Astahost Guidelines for
    GOOD web design ....
  19. Import From Excel File Into Mysql Database
    (14)
    Has anyone tried using the excel import function that comes with phpmyadmin
    http://www.phpmyadmin.net/home_page/ - it does not require any additional plug-ins or scripts and
    is fairly straightforward to use. In phpmyadmin, if you click on the database table which you wish
    to import the data to , there is a link on the bottom left corner which says "insert data from a
    text file into the table" - although it says text file it still can be used to import an excel file.
    When you click on this link you will be taken to a page where you will be asked for the file name
    (the....
  20. Free Dhtml Menu That Reads A Database
    Anyone know one? (7)
    Hey, anybody know a DHTML menu that reads info from a database? for people who don't know, just
    like windows' "start menu" with the popup menus I want to mod it so that in phpnuke I can edit
    it admin panel end. I would like it to be vertical. Do not use note tags because they are only for
    admins and moderators. ....
  21. Putting In Videos With Dreamweaver
    Clicking a link and opening them (5)
    Ive been to numerous sites where people can click on a link and download a video. Maybe its
    something very simple but idont know.... If someone could show me how do this using dreamweaver that
    would be appreciated... also where would i upload the file too... bc its a video, so would it go in
    just the public folder or in picture or what? plz tell me bc ive been wondering about this for a
    while, same thing with a music download link, i suppose they are the same thx in advanced jon....
  22. How To Link
    (9)
    i donr the pages for my site but ow it it time to link them properly how to do it i m doing like
    this is that right? http://mysite.trap17.com/index.htm it is ok or wrong? help on this...
    /ohmy.gif' border='0' style='vertical-align:middle' alt='ohmy.gif' /> ....
  23. Link To New Page?!
    (1)
    Ok.i have a link to this: http://hostjunkies.trap17.com/forums in an .html iframe.. and it goes up
    in there...i want to know how to make an HTML link so this http://hostjunkies.trap17.com/forums
    pops up in a new page.....

    1. Looking for database, retrive, data, link

Searching Video's for database, retrive, data, link
See Also,
advertisement


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

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com