3 Replies Latest reply on Oct 4, 2009 7:46 AM by jdesko

    TextArea TextFlow and TextConverter problem


      In FB4 I am sending data to php/mySQL using FB4 data services.  In the object that I am sending over is TextFlow from a TextArea; I am using (not the exact code)


      myObj.myTextFlow = TextConverter.export(textArea.textFlow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE);


      also at the end of the above code I've used .toString().


      The problem is if any of the TextArea text has a ' in it (for example - Starbuck's) the app gets a channel disconnected which usually means php/mySQL didn't like it.  The data in Network monitor's request looks good.  If the ' is taken out everything works.


      Any suggestions?

        • 1. Re: TextArea TextFlow and TextConverter problem
          mewk Level 3

          If you're seeing the "data disconnected" message it probably means that your server is returning bad data, probably a big fat error message.There are ways to debug your php script using log messages, error control handlers, php debuggers (like zend's debugger), etc. I would at a minimum configure an error handler to keep some kind of log or else you'll remain totally in the dark about the "data disconnected" message.


          Anyway, from your description of the problem it sounds like your db might not like the data it's receiving. You are using real_escape_string() before inserting data, right?


          - e

          • 2. Re: TextArea TextFlow and TextConverter problem
            David_F57 Level 5

            If you use remoteobjects with your data services could just send the object and store as bytedata saves on conversion upload/download etc...



            • 3. Re: TextArea TextFlow and TextConverter problem
              jdesko Level 2

              Thanks for the replies Mewk and David.  This solution was to simple - I was not using mysql_real_escape_string() for this php function;  I assumed I was so I was looking elsewhere.