RE: [PHP] ID NUMBER HELP
| From: | Demitrious S. Kelly | Date: | Wed, 27 Mar 2002 03:59:58 +0000 |
| Subject: | RE: [PHP] ID NUMBER HELP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90313@lists.php.net to get a copy of this message | ||
Try echo '<a
href="'.$PHP_SELF.'?id='.$row["ID"].'">'.row["name"].'</a>';
if $row["id"] still isn't shown, then you most likely aren't getting the
right data from the database to the correct variable...
-----Original Message-----
From: Omland Christopher m [mailto:Christopher.Omland@Colorado.EDU]
Sent: Tuesday, March 26, 2002 7:53 PM
To: heinisch@creaction.de
Cc: php-general@lists.php.net
Subject: [PHP] ID NUMBER HELP
Can someone help me with this. I'm trying to get ?id= set to the id
number
of the name in the database. I can get ?id="THE NAME" but I can't get it
to pick up the id number. here is the code i"m trying:
while($row = mysql_fetch_array($result))
{
printf("<a href=\"%s?id=%s\">%s</a><br>\n", $PHP_SELF,
$row["ID"], $row["Name"], $row["Name"]);
}
If I change the first $row["ID"] to $row["Name"] then ?id="Name here"
but
then when I try to extract the information from the database using:
$result = mysql_query("SELECT * FROM Profiles WHERE id=$id", $dbcnx);
$row = mysql_fetch_array($result);
It won't work, but in the address bar if I manually change ?id=1 then
the
information will load fine. Can anyone help?
Thanks.
-Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php