Stripping message column contents

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Sandengrip
Posts: 7
Joined: Thu Jul 18, 2013 7:38 am

Stripping message column contents

Post 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
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Stripping message column contents

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply