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:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 7:53 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
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





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to