MySQL ORD() function
MySQL ORD() returns the code for the leftmost character if that character is a multi-byte (sequence of one or more bytes) one. If the leftmost character is not a multi-byte character, ORD() returns the same value as the ASCII() function.
The formula to calculate the numeric values of its constituent bytes is :
(1st byte code) + (2nd byte code * 256) + (3rd byte code * 2562) ...
MySQL Version: 5.6
Example: MySQL ORD() function
The following MySQL statement returns 119.
mysql> SELECT ORD("w3resource"); +-------------------+ | ORD("w3resource") | +-------------------+ | 119 | +-------------------+ 1 row in set (0.00 sec)
All String Functions
Many of our valued users post comments along with piece of code. Disqus may, false positively, consider those piece of code as Bad or Starnge syntax and send those comments to spam automatically. Even if that happens, we will make sure those useful comments are taken out of spam and approved. It may take a couple of days for that though, but any useful comment will be brought to public view for sure. We regret if that happend to any user. You may write us directly regarding this to - w3resource[at]yahoo[dot]com.