-1

I have code id PHP for export to XML, and i dont know, where is problem ?

<?php  

$data=mysql_query("SELECT * FROM ``");

while($zaznam=mysql_fetch_array($data)){

$select = "select * from `` WHERE ID=".$zaznam['ID']."";
$proved =  mysql_query($select) or die ( mysql_error() );

$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "<Kurzy>\n";

for($x = 0 ; $x < mysql_num_rows($proved) ; $x++){
$row = mysql_fetch_assoc($proved);

$xml_output .= "\t<Kurz>\n";

$xml_output .= "\t</Kurz>\n";   
}

$xml_output .= "</Kurzy>";  
echo $xml_output;      
?>

My code sometimes write Error, sometimes no. Where is problem ?

1 Answers1

0

missing the closest of while loop } last line

$data=mysql_query("SELECT * FROM ``");

while($zaznam=mysql_fetch_array($data)){

$select = "select * from `` WHERE ID=".$zaznam['ID']."";
$proved =  mysql_query($select) or die ( mysql_error() );

$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "<Kurzy>\n";

for($x = 0 ; $x < mysql_num_rows($proved) ; $x++){
$row = mysql_fetch_assoc($proved);

$xml_output .= "\t<Kurz>\n";

$xml_output .= "\t\n";
}

$xml_output .= "</Kurzy>";  
echo $xml_output;   
}
?>
Osama Jetawe
  • 2,697
  • 6
  • 24
  • 40