I've got to re-learn my MySQL and PHP programming skills.
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?
UPDATE:
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 Comments
Glad I can help.
ReplyDelete