Need to alter data as written to database
Posted: Sun Feb 15, 2009 3:29 pm
I am monitoring apache logs and writing them to MySQL. The field request_URI always contains a forward slash before the actual URI, for example:
/universe.jpg
Which is normal and fine. Except I need to execute some queries against this field and it would be great if the forward slash wasn't there when I do those queries. I can do SUBSTRING(request_uri FROM 2) in the query, but I'd rather just filter out the forward slash before it is written to the database.
Is there some way to do that so that the forward slash never ends up in the field at all?
Thank you.
/universe.jpg
Which is normal and fine. Except I need to execute some queries against this field and it would be great if the forward slash wasn't there when I do those queries. I can do SUBSTRING(request_uri FROM 2) in the query, but I'd rather just filter out the forward slash before it is written to the database.
Is there some way to do that so that the forward slash never ends up in the field at all?
Thank you.