Need Help Turning Into Stored Function
I'd like to turn the following function into a MySQL stored function, but I'm fairly new to the concept:
int getCharacterLevel(int numXP)
{
int level = 1;
while (numXP > 4 + level)
numXP -= 4 + level++;
return level;
}
And then I would like to call it with php like
print mysql_result("SELECT getCharacterLevel(COUNT(XP)) FROM tbl_characters", 0);
Any ideas?
Subject
Written By
Posted
Need Help Turning Into Stored Function
September 05, 2008 11:59AM
September 05, 2008 12:07PM
September 05, 2008 12:13PM
September 05, 2008 12:18PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.