My code is no white spaces before or afther
<?php
ob_start();
header("content-type:text/xml; charset=UTF-8");
function getXML($sql="Default Query")
{
$conn=mysql_connect("*","*","*");
$db=mysql_select_db("*");
$result = mysql_query($sql,$conn);
$columns="";
echo "<records>";
while($row=mysql_fetch_assoc($result))
{
$columns.="<record>";
foreach($row as $key => $value)
{
$reptxt = str_replace("&", "&", $value);
$columns.="<$key>$reptxt</$key>";
}
$columns.="</record>";
}
echo $columns;
echo "</records>";
}
getXML("SELECT 0,1,4,5 FROM KK_VOISTLEJAD");
ob_end_flush();
?>
And error what i get is: Warning: Cannot modify header information - headers already sent by (output started at .../htdocs/data.php:1) in .../htdocs/data.php on line 2
Whats wrong?