Syntax:
ORD(str)

If the leftmost character of the string str is a multi-byte character,
returns the code for that character, calculated from the numeric values
of its constituent bytes using this formula:

  (1st byte code)
+ (2nd byte code x 256)
+ (3rd byte code x 2562) ...

If the leftmost character is not a multi-byte character, ORD() returns
the same value as the ASCII() function.

URL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html

