[thelist] Using a PHP variable as a column name in a MySQL statement

NanHarbisonSmith at aol.com NanHarbisonSmith at aol.com
Mon May 27 17:56:01 CDT 2002


--
[ Picked text/plain from multipart/alternative ]
OOH, brilliant! That was the solution. I never think to try concatenating.....
Thanks so much Joshua.
Nan

In a message dated 5/27/2002 6:43:24 PM Eastern Daylight Time,
joshua at waetech.com writes:


> > everything else is okay on this page. Can I not say:
> > $Query = UPDATE $TableName SET $position = '$replacement' WHERE meet_date
> =
> > '$meetdate'";
>
> Try this:
>
> $Query = "UPDATE " . $TableName . " SET " . $position . " = '" .
> $replacement . "' WHERE meet_date =
> '" . $meetdate . "'";
>
> HTH,
>
> -joshua
>


Nan Harbison Smith
481 Elm Street
Concord, MA 01742
978-369-1224
978-369-1681

Give a man a fish and you feed him for a day; teach him
to use the Internet and he won't bother you for weeks.





More information about the thelist mailing list