Skip to main content


I've got to re-learn my MySQL and PHP programming skills.

I have a field name contentdata with a hex data of AA560D72DA4AB20AAA using a type char.

In MySQL, I can run this command:
SELECT SUBSTR(hex(contentdata),15,2) FROM table1
output is: 0A

How can I code "SELECT SUBSTR(hex(contentdata),15,2) FROM table1" in PHP so I can bring the same result?

MySQL create php code gave me this recommendation but I can't show the value.
$sql = "SELECT SUBSTR(hex(payload),15,2) FROM device_status LIMIT"

Let me know what I'm missing here?

A member (Katherine) in domain name forum recommended to use "AS hex_value" to create aliases for the field resulting from expressions. It works!

So, I query the data using the codes below:
"SELECT SUBSTR(hex(contentdata),15,2) AS myHex_data FROM table1"


  1. Really like that you are providing such information on PHP MYSQl with JAVASCRIPT ,being enrolled at i really thank you for providing such information it was helpful.


Post a Comment

Popular posts from this blog

Alternative Social Networks

If you are planning to create your social network e.g. similar to Facebook. Here's a short list of alternative software's:

Open Source and Free​ - Wordpress (Open Source and Free) - (Open Source and Free)Commercial Social Networks software ($299 Stand Alone, $29/mo Cloud) (run with Joomla, need to know CMS) (very expensive, $399 for Standard) (from free to Commercial, I left my networks and they are selling it (I used this before, it's hard to maintain. I moved to NING but left too after it was sold to another company) (I don't recommend using this service, it's hard to export your data when it's time to move)Something to check when selecting your next soc…

Frequent Account Lockout in Active Directory

I have a user in Windows Pro 7, and Windows Server 2003 environment that is frequently account locked out. I tried many different scenarios to resolve this account lockout issue, from resetting his password, changing a new password, remove and re-join the domain, rebooting the workstation and active directory servers.

I tried to use the command prompt utility to run "rundll32.exe keymgrdll, KRShowKeyMgr" (case sensitive) to delete the account in Windows 7 password cache, and still no luck.

Still searching for answer ... Let me know if you encounter a similar issue in Windows Pro 7 and Windows Server 2003.

Continue reading updated post here:

Example of Out of Office Reply for Terminated Employee

This is a sample message that I used for terminated employees, unless HR staff specified a different message.
=== Example for KING.NET Employee === John Doe (employee or consultant) is no longer with KING.NET effective June 1, 2008 (termination date). For matters relating to "Project Name here" please direct your concerns to John Smith at (Manager or Supervisor). For all other matters, please direct your email to Mary Smith HR at
Please call our main office 703-345-6789 if you have other concerns.
Thank you.
=== end of message ===