i have the following code.
$stmt = $conn->prepare('SELECT sponsor_path FROM sponsors WHERE conference_id = ?');
$stmt->execute(array($cid));
$sponsorsImg = $stmt->fetchall (PDO::FETCH_OBJ);
$xml_output = "<?xml version=\"1.0\" ?>";
$xml_output .= "<sponsors>";
foreach ($sponsorsImg as $spImg){
$xml_output .= "<sponsor>
";
$xml_output .= "<image>".$spImg->sponsor_path."</image>
";
$xml_output .= "</sponsor>
";
}
$xml_output .= "</sponsors>";
echo $xml_output;
Instead of printing the results in xml format i get only the $spImg->sponsor_path
's content in plain text. Any ideas?