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

Joshua Olson joshua at waetech.com
Mon May 27 17:43:01 CDT 2002


From: <NanHarbisonSmith at aol.com>
Sent: Monday, May 27, 2002 6:31 PM


> 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





More information about the thelist mailing list