ID NUMBER HELP
| From: | Omland Christopher m | Date: | Wed, 27 Mar 2002 03:52:59 +0000 |
| Subject: | ID NUMBER HELP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90312@lists.php.net to get a copy of this message | ||
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