I have stored xml file in mysql BLOB datatype,so now i want to get that data in xml or json format and need to display.
i tried like this,but getting binary values
$mqs = db_select('multiple','mq')
->fields('mq',array('data'))
->condition('tokenid', '1')
->execute();
foreach ($mqs as $row) {
$test = base64_encode($row->surveyid); //here junk binary data displaying
drupal_set_message("data ::".$test);
$xml = simplexml_load_string($test);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
drupal_set_message("data::".$json);
}
actual data not displayed in XML or JSON formats?
any other alteatives?
