In Zeile 3 soll sich der Fehler befinden, werd daraus aber nicht schlau, verschiedene Varianten habe ich ausprobiert ("conection.php"); "conection.php"; 'conection.php';…
PHP:
<?php
// Connect to the database server
include ("conection.php");
// Open your database
mysql_select_db($database, $connection);
// Build a SQL query
$qry = "SELECT productID, price, imagePath, description FROM xml_to_flash";
// Run the query and collect the resultset
$rs = mysql_query($qry);
// How many results are there?
$totalRows = mysql_num_rows($rs);
// first define this is an XML document
$xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
// print the base node
$xml .= "<Products>\n";
// loop through the database and process the data
while ($row = mysql_fetch_array($result)) {
// start a new product element
$xml .= "<product number='" . $row["productID"] . "' image='" . $row["imagePath"] "' . price='" . $row["price"] . "'>";
// then the element value
$xml .= $row["description"];
// and then terminate the element
$xml .= "</item>\n";
}
// terminate the base node
$xml .= "</Products>\n";
// print the XML to the output
echo $xml;
// free memory
mysql_free_result($rs);
?>