Page 1 of 1

Stripping message column contents

Posted: Tue Aug 13, 2013 9:50 am
by Sandengrip
Running SQL queries on my HESK database, I realized how much crap is stored in the message column of helpdesk_tickets table. A few examples:

(image removed)
<br /> <br />
<a href="mailto: ..."

How would you either prevent this kind of data from being stored, or secondly - exclude these certain strings from what my SQL query returns?

Currently, my only idea is to use a raw-data Excel template with a lot of Find/Replace statements combined in a VBA script, but it's still no solution to the actual problem.

regards
William

Re: Stripping message column contents

Posted: Tue Aug 13, 2013 10:52 am
by Klemen
This "crap" is actually HTML code - messages are stored in HTML in HESK.

You will need to strip HTML tags from the message before using it,either with PHP or perhaps it can be done in Excel/VBA:
https://www.google.com/search?q=Excel+strip+HTML+tags
https://www.google.com/search?q=VBA+strip+HTML+tags

Or, if you have latest version of HESK, you can use the export to Excel functionality to get ticket data to Excel with the HTML markup already removed (Admin panel > Reports > Export tickets).