hey guys
was just taking a look at some examples to see I would go about inserting an xml file, I have tried a csv file a few times and have miserably failed. So figured I would give an xml file a go, could also become handy in my application, csv would be better and is more than needed but I guess it will have to do till I figure the other out.
I know there are a few threads here but they are all over the place, and with those so far I have just wasted a lot of time and not got anywhere in succeeding.
So I found this which generates an xml file, how would I go about changing this to import an xml file and insert into the database?
//get the xml contents
$str_xml = $this->createXml();
//path to tmp
$temp_file_name = "sc_orderxml_" . {orderid} . "_" . date("YmdHis") .".xml";
$path_file = $this->Ini->root . $this->Ini->path_imag_temp . "/" . $temp_file_name;
$url_file = $this->Ini->path_imag_temp . "/" . $temp_file_name;
if ( !file_put_contents($path_file, $str_xml) )
{
sc_error_message({lang_error_creating_file});
}
Any suggestions or even examples of either a csv or xml import and insert would be really great if anybody had some code they could share