Put URL and garbage in result from PHP

Hakan at Exformedia.se Hakan at Exformedia.se
Tue Oct 9 00:16:21 CDT 2012


If you access your data via command line. Is it OK then? Then I hope you instead of "SELECT xword FROM ydatabase" really wants "SELECT xword FROM YTABLE"? What does your HTTP-headers look like? maybe it's an encoding issue that somehow garbles LiveCode? I've never seen this issue in LiveCode myself.

:-Håkan

8 okt 2012 kl. 16:58 skrev Mark Schonewille:

> Hi,
> 
> I'm downloading a list of words of 9 characters from a MySQL database using a PHP script and a put URL command in a LiveCode script. Altogether, there are approximately 10000 lines in my list, with one word on each line.
> 
> Both the PHP script and the LiveCode script run on Mac OS X. I use a put URL command in my LiveCode script, such as
> 
> put url "http://localhost/~user/list.php"
> 
> The relevant part of the PHP script is:
> 
> $q="SELECT xword FROM ydatabase";
> $r=mysql_query($q);
> if (!$r) {
> 	echo 'An error occurred: '.mysql_error();
> }
> else {
> 	while ($row = mysql_fetch_array($r)) {
> 		echo "$row[0]\n";
> 	}
> }
> 
> Exactly every 8001 bytes (or 889 words, which are all different), I get some garbage:
> 
> 1f41
> AAAAAAAAA
> AAAAAAAAB
> [889 times]
> AAAAAAAAC
> 1f41
> AAAAAAAAP
> AAAAAAAAQ
> [889 times]
> AAAAAAAAR
> etc etc etc
> BBBBBBBBX
> 1e7d
> 
> The garbage is often the same but not always and it appears before the first line and after the last line. I have tried several combinations of the content-type and content-transfer-encoding headers in PHP. I have also tried changing the encoding of the PHP script itself.
> 
> If I call the same URL from CURL and pipe the output to a text file or if I open the URL in a browser, I don't see any garbage:
> 
> AAAAAAAAA
> AAAAAAAAB
> [889 times]
> AAAAAAAAC
> AAAAAAAAP
> AAAAAAAAQ
> [889 times]
> AAAAAAAAR
> etc etc etc
> BBBBBBBBX
> 
> Does anyone have an idea what causes LiveCode to add garbage to my list?
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com
> 
> 
> 
> 
> _______________________________________________
> 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