I do the following in my php code :
$q="SELECT * FROM {$table} where x;
$link = mysqli_connect("localhost", "test", "test","mytable");
$res = mysqli_query($link,$q);
if($res)
{
$row = mysqli_fetch_assoc($res);
header("Content-type: text/xml");
header("Content-Disposition: attachment; filename=$name");
echo $row['blob'];
}
I can see that the data(xml file) that I uploaded into mysql does not have any leading spaces but when I run the above code 3 new lines and a space appear and the file is not well formed xml any more. Any idea why the exact contents are not being read from the table?