Hello
i am trying to export products of a cscart multivendor from mysql to xml. I created an php file that creates an xml file. The code at the moment is:
//Create Database connection
$db = mysql_connect('','','');
if (!$db) {
die('Could not connect to db: ' . mysql_error());
}
//Select the Database
mysql_select_db("",$db);
$result = mysql_query("select * from cscart_products, cscart_products_categories, cscart_category_descriptions, cscart_product_descriptions, cscart_product_prices, cscart_product_options where cscart_products.product_id = cscart_products_categories.product_id and cscart_products_categories.category_id = cscart_category_descriptions.category_id and cscart_products.product_id = cscart_product_descriptions.product_id and cscart_products.product_id = cscart_product_prices.product_id", $db);
//Create SimpleXMLElement object
$xml = new SimpleXMLElement('');
//Add each column value a node of the XML object
while($row = mysql_fetch_assoc($result)) {
$mydata = $xml->addChild('mydata');
$mydata->addChild('sku',$row['product_code']);
$mydata->addChild('name',$row['product']);
$mydata->addChild('oldprice',$row['list_price']);
$mydata->addChild('price',$row['price']);
$mydata->addChild('description',$row['meta_description']);
$mydata->addChild('Category',$row['category']);
}
mysql_close($db);
//Create the XML file
$fp = fopen("test.xml","wb");
//Write the XML nodes
fwrite($fp,$xml->asXML());
//Close the database connection
fclose($fp);
?>
[b]My first problem is that i cant find in sql some more fields that i need like product url and main image.
The second problem is that i need to have all options including to xml.[/b]
For be more specific i need an xml exactly like this one:
[url="https://www.fashionbay.gr/XmlSamples/b2b4all.xml"]https://www.fashionb...les/b2b4all.xml[/url]
Any ideas?
thanks in advance