Ok, your query is running properly and you're getting a valid numeric result into the
$itemID variable. The issue lies within your
getItemStat function. It's returning the string '0'. This means that it is trying to access
$actions [0] when you're calling a function which is not set... thus, it's trying to call the function named as the null character. Since this is an invalid function name, you get an error.
Walk through the implementation of getItemStat with the parameters:
getItemStat('token', '2'); and you should be able to track down why this is returning a numeric string value.
You can get rid of the code alterations that I made now as they were strictly for diagnostic purposes.

*Note: var_dump() is a
great function because it not only prints out the value of its argument, but the type! Basically it just told you that:
$result IS a valid resource
$itemID IS a numeric STRING (you can use intval() if you want it to be an actual integer)
$token IS the numeric STRING '0'