#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    156
    Rep Power
    13

    Display all records using a link either in HTML or PHP


    Hi

    I have managed to get the results displayed based on the users input but now I need a link to display all records using either a html or php link and am bit stuck on how to do it

    Can anyone point me in the right direction please

    Thank you

    Ian
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,623
    Rep Power
    595
    I have no idea what you are asking.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    3
    PHP Code:
    while ($row mysql_fetch_array($result)) {
    echo 
    "<a href='www.example.com/".$row['value']."'> $row['value'] </a><br />";

    This will output everything in your database query - in separate headings that are linked to their individual record.
  6. #4
  7. For POny!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Amsterdam
    Posts
    416
    Rep Power
    115
    in case a link needs to fetch data you require $_GET variables.


    PHP Code:
    // You could use a link like this. http://example.com/index.php?article_id=3

    if(isset($_GET['article_id'])){

    //query database

    $query 'SELECT title, content FROM articles WHERE id='.(int)$_GET['article_id'];

    }else{
       
    //nothing


IMN logo majestic logo threadwatch logo seochat tools logo