Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    skinnypspplayer
    skinnypspplayer's Avatar
    Guest

    PHP help! Immediate 10 pts to best answer!?

    Alright, I have a MySQL database with a comments table. All I'm trying to do is to show any certain comments' ID number on a different page. Here's page with comments (scroll down):

    http://www.kingps3.com/_r3.php

    Now if you were to be an admin at the site you would see a link below each comment saying 'Comment ID'. All I want to be able to do is to click that and have it link to a diff. page (commentID.php) and show that certain comments' ID number. I put the link to the commentID.php page (below each comment) as:

    <a href="commentID.php?$cid='.$info2->id.'">Comment ID</a>

    So I want '$info2->id' to equal '$cid' but its not working. '$info2->id' works fine on the page with the comments but when I try to make it equal on the commentID.php page, it doesn't work. Here's the commentID.php page:

    <?php include('session.php');?>
    <?php
    $res = mysql_query("SELECT * FROM comments WHERE id='$cid'");
    while ($rec = mysql_fetch_array($res)){
    echo $rec[id];
    }
    ?>

    So to explain the above code, it goes like this. I click the 'Comment ID' link on the page with the comments which takes me to 'commentID.php?$cid='.$info2->id.'. If I look on the address bar after clicking the link I can see that $info2->id works because it will say for instance 107 (the comment's ID). But for some reason, it won't make it equal to $cid. So on commentID.php, when I try to pull up the ID of the selected comment, it doesn't show anything.

    Any help? Ask if you need more information (say what you need) and I'll add more details. Thanks!

  2. #2
    Erick1382
    Erick1382's Avatar
    Guest
    just skip, this is the easiest thing

 

 

Quick Reply Quick Reply

Click here to log in


What comes after M0nday

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 08-23-2009, 05:29 PM
  2. somesmart answer this plz 10 pts for answer n EXPLANATION=]?
    By BENNETH[[98]] in forum Discuss Science
    Replies: 0
    Last Post: 02-22-2009, 10:17 PM
  3. PHP/MySQL help! Immediate 10 pts to best answer!?
    By skinnypspplayer in forum Discuss PHP
    Replies: 0
    Last Post: 12-03-2008, 05:10 PM
  4. PHP help! Immediate 10 pts to best answer!?
    By skinnypspplayer in forum Discuss PHP
    Replies: 2
    Last Post: 12-03-2008, 05:01 PM
  5. Replies: 5
    Last Post: 05-13-2008, 10:08 AM

Bookmarks

Posting Permissions

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