Results 1 to 3 of 3

Thread: mysql and php database (linking data)

  1. #1
    Join Date
    Mar 2009
    Posts
    42
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Default mysql and php database (linking data)

    Hi all, I have a mind boggling problem. I will try to explain:

    Ok, I have a mysql database, on it I have a few tables one called track-listing with field names, "listingid", "Date", "Title (title of the mix)" and "Listing (track-listings in the mix)".

    Now I have a php page called track-listing.php.

    I have a div tag which should display the "Title" and "Date" from the database, and I have another div tag that should display the "Listing" from the database.

    Now the problem is, I would like to have the "Title" as links so that when you click on the different titles, it displays the Listing data relevant from the database in the other div tag.

    Here is a pic to help


    Hope this makes sence

    Any help would be greatly appreciated.

    Thank you.
    Last edited by john0611; 03-12-2009 at 03:05 PM.

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    This is where a relational database comes into its own. You will need to make a relation between the track title and the listings for that title.

    So you have two tables with the listings and the titles and then you connect the two by having a foreign key in the "listings" table which corresponds to the title of that mix.

    I hope you understand

  3. #3
    Join Date
    Mar 2009
    Posts
    42
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Default

    Hi Schmoopy,

    That’s great, I kind of know what you mean, but I can't think of the code or set-up to make it all work.

    Is there a link I can follow to read up on such info?

    Many thanks.

    John

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •