#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    San Antonio, Texas, USA
    Posts
    23
    Rep Power
    0
    Here's the deal, I'm working on this site that lists alot of bands, how would i got about creating something in php so that I can make a template and just have all the content from the band sites listed in it. If you dont understand what I'm talking about(i have a hard time explaning myself) I need something that will make something like this as an outcome http://www.shoutweb.com/channels/?artist=taproot I have just started using Php/MySQL and I hope you all understand. I NEED HELP!
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,648
    Rep Power
    4493
    Whenever you pass a variable in the url, php automatically creates it for you in the next page. so if you have the url:
    http://www.shoutweb.com/channels/?artist=taproot

    you'll automatically have a variable called $artist with value "taproot"

    you can do something like this:

    ****Page 1 - List Bands****
    <?php
    $result = mysql_db_query("select artist from bands_database");
    while (list($artist) = mysql_fetch_row($result))
    {
    echo "<a href="page2.php?artist=$artist">$artist</a><br>n";
    }
    ?>

    ****Page 2 - Show Artist****
    <?php
    //variable $artist automatically set
    $result = mysql_db_query("select artist,songs,members from bands_database where artist='$artist'");
    if (list($artist,$songs,$members) = mysql_fetch_row($query))
    {
    echo "Artist = $artist<br>n";
    echo "Songs = $songs<br>n";
    echo "Members = $members<br>n";
    }
    else
    {
    echo "Artist $artist not foundn";
    }
    ?>

    **********

    You'll have to establish a connection to mysql of course and check the syntax, but hopefully that gives you an idea..

    ---John Holmes...

IMN logo majestic logo threadwatch logo seochat tools logo