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:


<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?

Uhm… you could put a $ in front of that word and actually make it a variable?

<a href="editdetails.php?editdate=' . $editdate . '&recordid=' . [COLOR="Red"]$[/COLOR]recordid .' ">Edit</a>

That was a typo… it’s still not working.

&recordid=recordid

Are you missing a $ in there?

Okay… I’m assuming this line actually reads something like


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?