What error is it throwing? Sounds to me that you didn't sanitize it prior to sending it. The integer 2 works in MySQL regardless of if its a string or an integer so long as the strict datatype mode isn't enforced.
Can't tell you how to fix it really since this is using a completely custom connection. Possibly a MySQLi under the hood? If so, just use prepared statements.

semiSkim

01-14-2013, 09:53 PM

What error is it throwing? Sounds to me that you didn't sanitize it prior to sending it. The integer 2 works in MySQL regardless of if its a string or an integer so long as the strict datatype mode isn't enforced.
Can't tell you how to fix it really since this is using a completely custom connection. Possibly a MySQLi under the hood? If so, just use prepared statements.

Thanks for the input, I have started to narrow down the issue. The code in question is generating a table of displaying data. Included are selected boxes acting as filters. The table construct is sent to javascript via json which then modifies the object when the user changes something and makes an ajax request call with the new object.

THE ISSUE: When grabbing the data from JSON an extra 10 chars have appeared when performing a check with strlen:

Lesson of the day, never ever ever urlencode a JSON string in javascript...... I actually remember thinking at the time it probably doesn't need it.... but hey why not it can't hurt! ......how wrong could I be!?

Fou-Lu

01-14-2013, 10:42 PM

What makes it too long? Too much trailing space? Too much preceding space? Conveted entities? You'll need to figure out what is making it longer than expected.

Lols, glad you got it figured out. Jeez I was away for almost an hour? Awesome.
You should be safe using encoding on the *data* you are giving to the JSON, but it likely wouldn't be necessary. Never (for lack of a better term) molest the data after its been converted by something like json_encode. That's like changing the data directly given during a pack command and hoping you can read it out.