I am updating a row in a table, and trying to return the updated row, as per this SO answer.
My code is the following:
$sql = \"SET @update_id := \'\
It's failing on ->fetchAll() because an UPDATE query does not return any rows/data.
What you want to do, is check out PDO::rowCount(). This returns the count of how many rows have been affected by your query.
echo $stmt->rowCount();
This was posted assuming you're trying to check if your query was successful.