1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Fetch all row data with respect to $title link

Discussion in 'PHP' started by haradeep, Dec 13, 2008.

  1. #1
    I want to display $title in one page and fetch all row data in my next page by using link.

    my code goes in this way:

    while($row = mysql_fetch_array($result))
    {
    echo "<body bgcolor=\"#FFFAFA\">";
    echo "<a href=\"2.php\">"; //I want 2.php to fetch all data related to title
    echo ucfirst($row['title']);
    echo "</a>";
    echo "<br />";
    echo ucfirst($row['description']);
    echo "<br />";
    echo $row['city'];
    echo "<br />";
    echo "</body>";
    }



    this is my first page

    I want second page
     
    haradeep, Dec 13, 2008 IP
  2. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #2
    try this
    
    //put all data field on session
    session_start();
    $_SESSION['data'] = $row;
    
    PHP:
    after that,
    on 2.php file
    
    session_start();
    $data = $_SESSION['data'];
    print_r($data);
    
    PHP:
     
    misbah, Dec 13, 2008 IP
  3. haradeep

    haradeep Well-Known Member

    Messages:
    231
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #3
    NOt working
     
    haradeep, Dec 14, 2008 IP
  4. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #4
    put this line
    $_SESSION['data'] = $row;
    PHP:
    after this line
    while($row = mysql_fetch_array($result))
    {
    PHP:
     
    misbah, Dec 15, 2008 IP
  5. haradeep

    haradeep Well-Known Member

    Messages:
    231
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #5
    Thanks for the help. I did this in other way and its works.
     
    haradeep, Dec 15, 2008 IP