SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing more than one value

    Hi, I have what I'm sure is a simple problem to solve but I can't find info on it anywhere on the web... maybe I'm not asking it in the right way.

    So basically I have a page that outputs records from a mySQL db, and I have an Edit and Delete link next to each record. When a user clicks Edit, the idea is two values that make that record unique are passed to a page where that record's details can be edited.

    The Edit link is as follows:

    PHP Code:
    <a href="editdetails.php?editdate=' . $editdate . '&recordid=' . recordid .' ">Edit</a
    Now the first value is sent ok in the link, so can be put into a mySQL query in the next page- but the second value (recordid) is outputted literally (i.e &recordid=recordid) in the link. I know it's not a problem with the variables themselves because if I swap them round, it's still whichever is the second one that is sent literally.

    Any ideas how I can solve this?

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,747
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)
    Uhm.. you could put a $ in front of that word and actually make it a variable?
    Code:
    <a href="editdetails.php?editdate=' . $editdate . '&recordid=' . $recordid .' ">Edit</a>

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was a typo... it's still not working.

  4. #4
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,909
    Mentioned
    96 Post(s)
    Tagged
    0 Thread(s)
    &recordid=recordid
    Are you missing a $ in there?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  5. #5
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,747
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)
    Okay.. I'm assuming this line actually reads something like
    PHP Code:
    echo '<a href="editdetails.php?editdate=' $editdate '&recordid=' $recordid .' ">Edit</a>'
    cause otherwise it makes no sense.

    Now, assuming that's true, have you echoed $recordid to make sure it actually contains what you think it does?


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
  •