I am starting to use json fields in my Mariadb database and it looks like it will be great in some circumstances, but I have a problem. When I feed that json into an Alpha json function, I have to escape the quotation marks. Easy enough to do by hand in the examples in documentation that only have two quotes, but I have hundreds.
I tried strtran() but it burps. What is the trick to change " to " everywhere?
For any of you that are interested, here is what I'm finding:
So far, we have 1.3 million inspection result records in our tables plus history logs of who made the changes, who did the inspections, the result of QC plus tables of defects found and how they were resolved. With Json, we will still have 1.3 million records, but in a smaller table and without those extra tables. We have two simple text fields in the record, one of which contains stuff like this:
[{"when":"2017-10-21 1105", "type":"O", "by":"33", "source":"E", "text":"POC approved."},
{"when":"2017-10-20 0645", "type":"O", "by":"1244", "source":"P", "text":"The orifice was changed to .05 in and is now 99 percent."},
{"when":"2017-10-12 1533", "type":"O", "by":"33", "source":"E", "text":"The burner is overfired and the design should be reviewed for safe operation."},
{"when":"2017-10-10 0906", "type":"Q", "by":"3", "source":"Q", "text":"This should be changed to a recommendation"},
{"when":"2017-10-08 1515", "type":"D", "by":"2,22", "source":"F", "text":"The burner is overfired and must be reduced for safe operation."}]
So, it contains the date, the evaluation at the time of the entry, who decided it, what department was responsible and what was found. To me, as Deon would say, this is amazing and very cool.
I tried strtran() but it burps. What is the trick to change " to " everywhere?
For any of you that are interested, here is what I'm finding:
So far, we have 1.3 million inspection result records in our tables plus history logs of who made the changes, who did the inspections, the result of QC plus tables of defects found and how they were resolved. With Json, we will still have 1.3 million records, but in a smaller table and without those extra tables. We have two simple text fields in the record, one of which contains stuff like this:
[{"when":"2017-10-21 1105", "type":"O", "by":"33", "source":"E", "text":"POC approved."},
{"when":"2017-10-20 0645", "type":"O", "by":"1244", "source":"P", "text":"The orifice was changed to .05 in and is now 99 percent."},
{"when":"2017-10-12 1533", "type":"O", "by":"33", "source":"E", "text":"The burner is overfired and the design should be reviewed for safe operation."},
{"when":"2017-10-10 0906", "type":"Q", "by":"3", "source":"Q", "text":"This should be changed to a recommendation"},
{"when":"2017-10-08 1515", "type":"D", "by":"2,22", "source":"F", "text":"The burner is overfired and must be reduced for safe operation."}]
So, it contains the date, the evaluation at the time of the entry, who decided it, what department was responsible and what was found. To me, as Deon would say, this is amazing and very cool.
Comment