This topic is locked
[SOLVED]

 HEX TO ASCII SEARCH ISSUE

11/3/2017 2:15:13 PM
PHPRunner General questions
C
cadman12 author

romaldus helped me with the hex to ascii problem I had but now the search tool in the app only recognizes the original hex in the database and I cant search for any ascii characters. For example to search for "BA" I would have to search for "4241". <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=25125&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

romaldus 11/3/2017



romaldus helped me with the hex to ascii problem I had but now the search tool in the app only recognizes the original hex in the database and I cant search for any ascii characters. For example to search for "BA" I would have to search for "4241". <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=83640&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' />


The easiest way to tho this, use MySQL unhex function to convert hex to string.
Modify your sql query in phprunner, for example your hex values stored in column4:



SELECT

column1

column2,

column3,

CAST(UNHEX(column4) AS CHAR CHARACTER SET utf8) AS my_result

FROM my_table


Now you are able to search

Don't forget to remove all custom codes you may use in "view as custom" in visual editor to convert hex to string
[size="2"]It is important to remember that "view as custom" in visual editor not affect sql query. [/size]

[size="2"]"View as Custom" manipulates field values displayed in list, view and print pages.[/size]

romaldus 11/3/2017

One useful tip to avoid perform complex php coding in phprunner:
Since phprunner is a database centric app, use built in database functions as much as possible

Besides avoiding complex coding, using DB built in function reduces coding time, minimize security bug

C
cadman12 author 11/6/2017

Thanks once again romaldus, works great.