After some more research i figured out that i need a function in the database. Something like this.
But i can not get it to work properly.
Code:
CREATE  FUNCTION `return_value`(login_ char(30), stat_ char(10)) RETURNS int(11)
BEGIN
declare ret int(11);
set ret = null;
select stat_  from cod2stats.player_information where login = login_ into ret;
RETURN ret;
END
When i try executing it in MYSQL Workbench it gives me "Error Code: 1366. Incorrect integer value: 'kills' for column 'ret' at row 1".
But if i change it to "select kills from cod2stats.player_information where login = login_ into ret;" it returns the correct value. Any suggestions?