Here is my code:
$page = 'home';
$data = 'blah blah blah';
// my database connection (i know there is no problems here);
require_once('../inc/connection.php');
$id = 1;
$values = array(
':page' => $page,
':id' => $id,
':data' => $data
);
$query = 'UPDATE site SET :page=:data WHERE id=:id';
$sql = $conn->prepare($query);
$sql->execute($values);
// this prints out perfect
echo 'UPDATE site SET '.$page.'='.$data.' WHERE id='.$id;
When I run this page it prints the echo at the end, but when I check my site table it does not reflect the update. I have no idea what I am doing. The connection is good because I am making select queries just fine.