First I'm going to assume that your table's name is tbl_orders. Then I'm going to assume that there's more than one "price" field for each session_id. The following will do what you want:
$query = "select price from tbl_orders where session_id = $session";
$result = mysql_query($query);
$result = mysql_fetch_array($result);
$num_results = mysql_num_rows($result);
$sub = 0;
(insert a loop here that I'm not sure how to implement)
That code will generate an associative array of all of the "price" fields that match the session_id help in $session. You'll then need to write a loop that will run through the array, using $num_results to determine how many times to run through the loop, and for each pass through the loop, add on to the value of "Sub".