dynamic page url variables from database

Discussion in 'PHP' started by pein87, Sep 24, 2010.

  1. pein87

    pein87 Active Member

    Joined:
    Aug 6, 2010
    Messages:
    173
    Likes Received:
    47
    Trophy Points:
    28
    Occupation:
    Web Dev
    Location:
    Limbo
    I was wondering what is the best way to do this.

    I want to be able to store the variable and value in a database but use php to turn them into a url variable combo.

    Ok lets say I have a database table called locations with this structure

    Database Columns


    • location_type
    • location_name
    • location_image
    • location_summary
    • rpg
    • parent


    I want the code to take location_type as the variable and location_name as the value

    like lets says location_type has the value village and location_name would be leaf

    the url would be rpg.php?rpg=naruto&village=leaf

    the rpg part will be hard coded but I want to dynamically create the(highlighted in red)

    rpg.php?rpg=naruto&village=leaf

    from the database, does anyone know of a good way to do this?
     
  2. Madhu_byke

    Madhu_byke New Member

    Joined:
    Dec 4, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I have a similar query, which goes this way.

    I am actually printing all the records in the table and creating a href

    echo "<td>" . '<a href="products.php">' . $row['SubcategoryName'] . '</a>' . "</td>";

    now my problem is i need the value of the $row['SubcategoryName'] that I had clicked.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice