Hello,
Is it possible to issue sql statements such as:
UPDATE tablename SET fieldname = 42,
but having fieldname as a PHP variable. If so, what would the syntax be?
Thanks
Andy.
You can just embed a variable into the string that is your query, same as for any other double-quoted PHP string. Have as many items be variables as you like:
$qry = "update $some_table set $some_numeric_column = $num_value, $some_text_column = '$text_value'";