Re: <A ref query problems
| From: | Nikos Avradinis | Date: | Mon, 11 Dec 2000 09:54:23 +0000 |
| Subject: | Re: <A ref query problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29651@lists.php.net to get a copy of this message | ||
Try this:
<?php
#assume that you've read from db and you got values stored in the following
variables:
$username="Michael Jordan";
$user_id=3;
$number=4;
?>
<html>
<head>
<title>Example</title>
</head>
<body>
<b>Real Name:</b><?php echo "<a
href=\"/listphoto.php?field=".$user_id."&query=".$number."\">".$username
."</a><br>"; ?>
</body>
</html>
----- Original Message -----
From: "Altaf Shaikh" <bshaikh@nyc.rr.com>
To: <php-general@lists.php.net>
Sent: Monday, December 11, 2000 11:37 AM
Subject: [PHP] <A ref query problems
> Hello,
>
> I am having trouble with the following the script I have omitted some of
the
> connect database junk, so what I am asking is clear.
>
>
> $imagedbresult = mysql_fetch_row (mysql_query ("SELECT * FROM sp_image
WHERE
> id = '$id'", $mysql_link));
>
> $userdbresult = mysql_fetch_row (mysql_query ("SELECT * FROM sp_user WHERE
> id = '$imagedbresult[1]'", $mysql_link));
>
>
> The below part is what I am having trouble with. The user name should be
> highlight as link and the query should go to a document called
listphoto.php
> The code starting with <A HREF..... is wrong and I would like to know what
> the proper syntax should be. The output of the query when clicked should
> look like /listphoto.php?field=user_id&query=NUMBERHERE Basically it
needs
> to take the user_id # and place it in the statement. Unfortunately it does
> not look like that and I tried every variation I could think of to make it
> look like that, if you can please assist. I think i put all the relevant
> information in this email.
>
>
> <b>Real Name:</b> <? print $userdbresult[5]?> <a href="<?
> listphoto?field=user_id&query=>" </a><br>
>
>
> Thank you for your time.
>
> Al
>
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>