xml import syntax - OR: no record is being added

Discussion in 'MySQL' started by Michael-DK, May 19, 2011.

  1. #1
    I am about to move a webshop from database A to database B via XML files. I admit, I know very little about MySQL and XML, or at least not the basic, so I have been trying on trial and error basis.

    I use Notepad++ and have made an export from Database A to an xml file. I have created and installed the new shopping cart, OpenCart. This is Database B and I have also made an export xml file to be able to se format and syntax in xml.

    When trying to import with the file shown I sometimes got an error having to do with the charset, but with this file everything is OK, but no record is added to the dabases. Why ? Could you please advise me, what I need to change.
    Thank you very much.
    Michael, Denmark


    <?xml version="1.0" encoding="utf-8"?>
    <pma_xml_import version="1.0">
    	<pma:structure_schemas>
    		<pma:database name="frig-oc">
    
                <pma:table name="category">
                    CREATE TABLE `category` (
                      `category_id` int(11) NOT NULL AUTO_INCREMENT,
                      `image` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                      `parent_id` int(11) NOT NULL DEFAULT '0',
                      PRIMARY KEY (`category_id`)
                    ) ENGINE=MyISAM AUTO_INCREMENT=44 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
                </pma:table>
    
    		</pma:database>
    	</pma:structure_schemas>
    
    <database name="frig-oc">
            <table name="category">
                <column name="category_id">44</column>
                <column name="parent_id">0</column>
                <column name="status">1</column>
            </table>
    </database>
    </pma_xml_import>
    Code (markup):
     
    Michael-DK, May 19, 2011 IP
  2. Michael-DK

    Michael-DK Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I changed to this and then it worked ;-)

    <?xml version="1.0" encoding="utf-8"?>
    <xml_import version="1.0">
    <database name="frig-oc">
            <table name="category">
                <column name="category_id">44</column>
                <column name="parent_id">0</column>
                <column name="status">1</column>
            </table>
    </database>
    </xml_import>
    Code (markup):
     
    Michael-DK, May 19, 2011 IP