[mapserver-users] MySQL Blob vs Text issue with mapserver
john
oldbucsfan at hotmail.com
Fri Aug 15 13:06:34 PDT 2008
Found a workaround:
http://ifelse.co.uk/archives/2004/09/18/hex-to-ascii-php-script/
Modified function here for hex data to string:
<?php
function hexToAscii($hex)
{
$strLength = strlen($hex);
$returnVal = '';
for($i=0; $i<$strLength; $i += 2)
{
$dec_val = hexdec(substr($hex, $i, 2));
$returnVal .= chr($dec_val);
}
return $returnVal;
}
?>
However, I have yet to find a way to test if a string is hex (as opposed to
an int or a character string that just happens to have a few hex chars in
it), otherwise I will have to do it on each field individually which really
is not the best way to handle this. This needs to be fixed when the results
are queried out of the database where MySQL returns flags that determine if
a field is Blob or Text.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080815/261a0af1/attachment.htm>
More information about the MapServer-users
mailing list