<?php include "../../root.class.php";
$db = new db_safeguard();

$result = $db->query("order_trans","SELECT SUM(amount) AS total FROM order_trans WHERE stock_id = '".$_GET['stock_id']."'");

$data = $result->fetch_assoc();
echo $data['total'];