Det finns inga features
, contributions
, likes
i ditt tillstånd. Du anger också fel namn som parameter user_ID
.
<?php
$stmt = $dbh->prepare("SELECT sum(features + contributions + likes) AS total FROM points WHERE (ID = :user_ID)");
$stmt->bindParam(':user_ID', $user_ID, PDO::PARAM_INT);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo '<h3>'. $user_ID .' have '. $row['total'] .' Points.</h3>';
?>