SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: additional id?

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    additional id?

    i have a code here:
    Code:
    $edit = '<a href="reportcommentedit.php?cid='.$_GET['pid'].'" class=under>EDIT</a>';
    just like to know if it is possible if i add another id, lets say eid(for edit id) after or before the cid declaration?

  2. #2
    SitePoint Enthusiast Bobbi's Avatar
    Join Date
    Mar 2005
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You mean like this?
    Code:
    $edit = '<a href="reportcommentedit.php?cid='.$_GET['pid'].'&edit=' . $_GET['eid'] . '" class=under>EDIT</a>';
    That'd be no problem, you can add as many as you want to that way.

    Good luck,
    Bobbi

  3. #3
    I am The Best Idiot. Period.
    Join Date
    Feb 2004
    Location
    Massachusetts.
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes it is possible,
    PHP Code:
    $edit '<a href="reportcommentedit.php?cid=' $_GET['pid'] . '&eid=' $_GET['eid'] . '" class=under>EDIT</a>'
    Hope that helps.

    EDIT: Damn, too slow.....lol

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tnx guys....

    i cant fetch the commentID...i dont know why...maybe you can help me point the error
    Code:
    $editquery = "SELECT postID, username, commentID FROM comments WHERE postID='$id' AND username='$uname'";
        		$editresult = @mysql_query($editquery) or die(mysql_error());    
        		if (mysql_fetch_assoc($editresult))
        		{
    
    				$edit = '<a href="reportcommentedit.php?eid='.$_GET['pid'].'&cid='.$row[2].'" class=under>EDIT</a>';
        		}
        		else
       			{
            		$edit = '&nbsp;';
        		}
    when i do this, and i try to put the cursor above the link, eid is getting its value from another table....from the posts table...

  5. #5
    SitePoint Enthusiast Bobbi's Avatar
    Join Date
    Mar 2005
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So many confusing parts in your script ... here is how I would do it
    PHP Code:
    $editquery "SELECT postID, username, commentID FROM comments WHERE postID='$id' AND username='$uname'";

    $editresult = @mysql_query($editquery) or die(mysql_error());

    if (
    mysql_num_rows($editresult) == 0) {
        
    $edit '&nbsp;';
    } else {
        
    $editdata mysql_fetch_array($editresult);
        
    $edit '<a href="reportcommentedit.php?eid='.$_GET['pid'].'&cid='.$editdata['commentID'].'" class=under>EDIT</a>';

    I don't know your script good enough to tell you what went wrong with the stuff you posted above though...

    Bobbi


Bookmarks

Posting Permissions

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