I need to dynamically generate the column name I need to update in Postgresql from PHP. Here\'s the code and the error:
$Col = \"dog_\".$Num.\"_pic\"; $query_par
You can't bind columns names in your query:
$sql = "UPDATE users SET `:dog_col`=:dog_path WHERE `username`=:user_id_";
In this case you must use a variable like this:
$column = 'myColumn'; $sql = "UPDATE users SET $column = :dog_path WHERE username = :user_id_";