The table looks sth like this...
CREATE TABLE files (
file_id int(10) unsigned NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
size bigint(20) unsigned NOT NULL default '0',
downloads int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY id (id)
) TYPE=MyISAM;
INSERT INTO users files (1, 'file1', 10000, 50);
INSERT INTO users files (2, 'file2', 70000, 10);
Now, I want to calculate ( size * downloads ) for all rows, like for this one it would be...
10000 50 = 500000
70000 10 = 700000
TOTAL TRANSFERED = 1200000 bytes
I know it's simple but I don't know how to do this. Can anyone help me with this?