Sql problem
William Prothero
waprothero at gmail.com
Sun May 21 20:45:07 EDT 2017
Never mind. I got it working. I’m not exactly sure about the problem because the method I used should have been quite general. However, what made it work is that I had the contents of a list field in the array I was storing and that somehow caused an error when I tried to decode the array. I deleted that array key, because there was no reason I needed to have it in the db anyway, and it worked.
I’ll look into why and report back if I find anything interesting.
Best,
Bill
> On May 21, 2017, at 5:23 PM, William Prothero via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Whoops, I lied.
> The data is stored incorrectly in the simulator too.
> Hmm….
> The IDE stores it correctly. There is something in the encoding that I’m missing.
> Bill
>
>> On May 21, 2017, at 5:03 PM, William Prothero via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> Folks:
>> I have an app that stores data to a mysql database on my server. It works fine in the IDE and in the iPhone simulator. However, when I load the app onto the iPhone, the saved data is corrupted.
>>
>> I am saving an array. The array is saved in a big string that has been base64 encoded.
>>
>> When saving, I do:
>>
>> put arrayEncode(tArray) into tData
>>
>> put base64encode(tData) into xData
>>
>> put urlEncode(xData) into xData
>>
>> xData is sent to the db
>>
>> When I read back the data, I do the inverse:
>>
>> urlDecode
>> base64Decode
>> arrayDecode
>>
>> The base64 data on the db is different when I store it from the iPhone. I can see this with Navicat, which I use for db management. So, the problem is in the storing of the data.
>>
>> What the heck? I am just using a post command to a php script that writes to the db.
>>
>> Why would the iPhone data that is sent be different from that sent in the simulator?
>>
>> Mac OSX 10.12.4, Livecode 8.1.4 (rc2) and XCode 8.3.
>>
>> Any suggestions would be welcome.
>> Thanks,
>> Bill P.
>>
>> William A. Prothero
>> http://earthlearningsolution.org/
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list