String Functions MySQL Tutorial

Returns 0 if str is the empty string.
Returns NULL if str is NULL.
ASCII() works for characters with numeric values from 0 to 255.

mysql>
mysql> SELECT ASCII('2');
+------------+
| ASCII('2') |
+------------+
|         50 |
+------------+
1 row in set (0.00 sec)
mysql> SELECT ASCII(2);
+----------+
| ASCII(2) |
+----------+
|       50 |
+----------+
1 row in set (0.00 sec)
mysql>