Hi,

My Title isn't that good as I'm not sure how to describe what I want to achieve.

Basically I want to produce a line Chart using data from a MySQL Table.

my Y-axis changes every week and what I'm trying to do is sum as I go the data points. Every week I will add a new value and I want the valy1 to calaculate dynamically.

Example here is my data points for valy
valy
40
2
56
11
8
17

I want to be able to sum them up like below in another column valy1

valy1
40
42
98
109
117
134

I found this code for a stored procedure and I can get it to work in Heidi SQL but it doesn't update my table when I run the procedure.

Code:
BEGIN

SELECT value, valy,

@valy := CASE WHEN @value = value THEN @valy1 + valy ELSE valy END AS

valy1,

	@value := value
	
FROM (
		SELECT @valy1 =0,
		@value := NULL
		
		) vars,
		
		iterate_x
		
ORDER BY

value;
END

I'm not sure even how to CALL this Stored Procedure either. I plan to use jpgraph to populate my chart so I guess I need a while loop to get my chart points.

Regards

I