PHP PDO Related: Update SQL Statement not Updating the content of Database
- by Rachel
I am trying to implement update statement using prepared statement in php script but it appears that it is not update record in the database and am not sure why and so would appreciate if you can share some insights.
Code
$query = "UPDATE DatTable SET DF_PARTY_ID = :party_id,
DF_PARTY_CODE = :party_code,
DF_CONNECTION_ID = :connection_id WHERE DF_PARTY_ID = ':party_id'";
$stmt = $this->connection->prepare($query);
$stmt->bindValue(':party_id', $data[0], PDO::PARAM_INT);
$stmt->bindValue(':party_code', $data[1], PDO::PARAM_INT);
$stmt->bindValue(':connection_id', $data[2], PDO::PARAM_INT);
$stmt->execute();
Inspiring Solution leading to this approach. Any Suggestions ?