$query = 'SELECT weight FROM append';
$statement = $db->prepare($query);
$statement->execute();
$row_data = $statement->fetchAll();
$total_rows = $statement->rowCount();
if ($total_rows > 0){
foreach ($row_data as $row) {
echo '<br>'.$row['weight'];
$result = $row['weight'];
echo '<br>'.$result;
}
}
Assuming you are already connected to the database ($db) this will work 100%.