Simple (hopefully) string parsing question.
Posted: Fri Aug 01, 2008 9:27 am
I have a mySQL database full of data about our inventory.
One of the fields in the table I'm working with carries the dimensions of the item, expressed mainly in standard shorthand. Such as 3'6"x2'x6'4"
I often need to store the contents of this field somewhere while my code does other things.
The trouble I'm having is that any time I assign the data to anything other than a text element it strips off the last double quote, if there is one.
For instance, if I load the data directly from a recordset reference into a Select list element the data looks just as it should. But if I assign the data to a variable or pass it to POST or to Javascript it always removes the last double quote.
I've tried every combination of addlslashes(),stripslashes(), magic_quotes_gpc and magic_quotes_runtime that I can think of.
Through trial and error I found methods that make everything up to that last character work just fine. But that last double quote always turns up missing.
I suppose, if I have to, that I can do all the database stuff when the page is loaded and just leave it static. But I was really hoping to make it more dynamic if possible.
One of the fields in the table I'm working with carries the dimensions of the item, expressed mainly in standard shorthand. Such as 3'6"x2'x6'4"
I often need to store the contents of this field somewhere while my code does other things.
The trouble I'm having is that any time I assign the data to anything other than a text element it strips off the last double quote, if there is one.
For instance, if I load the data directly from a recordset reference into a Select list element the data looks just as it should. But if I assign the data to a variable or pass it to POST or to Javascript it always removes the last double quote.
I've tried every combination of addlslashes(),stripslashes(), magic_quotes_gpc and magic_quotes_runtime that I can think of.
Through trial and error I found methods that make everything up to that last character work just fine. But that last double quote always turns up missing.
I suppose, if I have to, that I can do all the database stuff when the page is loaded and just leave it static. But I was really hoping to make it more dynamic if possible.