[Wolves] mysql select help - a little one ;-)

Iain Cuthbertson iain at cuth.eu
Wed Apr 4 14:10:31 UTC 2012


On 04/04/12 14:45, Wayne Morris wrote:
> Last query working well.
>
> Can I have some help with basic syntax of passing two variable:
>
> I currently have:
>
>     print("<TD><a href=\"update.php?id=".$row["id"]."\"
> target=\"_blank\">Update</a>");
> which produces:
> updatetest.php?id=2
>
> i want to also pass over a date of birth 'dob'
> to get something like
> updatetest.php?id=2,dob=2343
>
> but no matter how I fiddle with things like:
> print("<TD><a
> href=\"updatetest.php?id=".$row["id"].?dob=$row["dob"]."\"
> target=\"_blank\">Update</a>");
>
> I get nowhere.
>
> Anyone?
>
> cheers
>
>
>
>
> _______________________________________________
> Wolves LUG mailing list
> Homepage: http://www.wolveslug.org.uk/
> Mailing list: Wolves at mailman.lug.org.uk
> Mailing list home: https://mailman.lug.org.uk/mailman/listinfo/wolves
Hi Wayne,

Multiple key/value pairs are separated by the & in query strings.
Though, to correctly validate, one should write it as &amp;

Your line might then look like this:
<td><a href="updatetest.php?id=<?php echo $row['id']; ?>&amp;dob=<?php
echo $row['dob']; ?>" target="_blank">Update</a></td>

Or, if you wanted it all in PHP:
echo '<td><a href="updatetest.php?id=' . $row['id'] . '&amp;dob=' .
$row['dob'] . '" target="_blank">Update</a></td>';

Hope this helps,
Iain





More information about the Wolves mailing list