I have a simple SQL statement where I am biding variables and it is not binding. The values work when hard coding them in the update statement but do not work when I bind them:
if(isset($_GET["coachUpdate"])) {
if ($pdoLink = \Database::GetInstance()->GetPDO()) {
$updateQuerySQL = "UPDATE Registration SET Coach = :coach WHERE Reg = :reg";
if ($updateQuery = $pdoLink->prepare($updateQuerySQL)) {
$bindValues = "";
$bindValues[":reg"] = $_GET["Reg"];
$bindValues[":coach"] = $_GET["Coach"];
if ($updateQuery->execute($bindValues)) {
if ($query->rowCount()) {
echo $updateQuerySQL;
}
}
} else {
echo "Registration update query prep failed.<br />";
}
}
}