Importing a XML file to MySQL via phpMyAdmin - mysql

I'm trying to import a XML file via phpMyAdmin and map each of the child elements to their corresponding fields within a MySQL table. XML sample:
<event>
<date>1992</date>
<title>Event Title</title>
<description>Event description goes here.</description>
</event>
I have MySQL fields within the table with names identical to the child elements listed above, however, when I import my XML file, I get a message that says "0 queries executed," and of course nothing gets imported.
I tried looking this up via the phpMyAdmin documentation, but I couldn't find anything but a modest description of XML as an import method. How is this supposed to be done?

phpMyAdmin doesn't provide a feature to map XML-elements to corresponding table fields. Sorry.
You need to write a program to do this trick. Or enhance phpMyAdmin.

Sorry but, did you try to do a ISO XML? Why dont you try with the head, and all the things that come with the standard XML? If you can't, try CSV. But the way that phpmyadmin parses the files are very specific

Related

import csv with empty title or description in Prestashop

I have a csv file with over 10,000 products but when i try to import i get the below error
Property Product->description is not valid
Property Product->name is not valid
So when i checked those products in the csv, they dont have a description or title. Since there are over 10000 products its very difficult to sort the ones with the title or description.
So is there away to import the file even the fields are empty? Im using Prestashop 1.7
Any help will be appreciated
this post is still popular for somebody. that's why I want to reply it.
so, this problem occurs when the import file's structure is not correct for P.S
there is a strange stiation for export/import on Prestashop side. Today I export categories from 1.7.8.7 and try to import on another store which is same P.S version. But I faced the same error.
Then, I downloaded the sample import data from P.S Admin, relasided that the structure was different (exported csv vs example-import csv file).
To download example CSV file, see here: https://prnt.sc/ieZIAsXOkH8y
To understand the differences, see here: https://prnt.sc/MAyd5weCvvNX
So, I replaced the structure like example-import csv, finally it worked!
The point is being sure about your import file's structre is same with the Prestashop expectation.
Note that the error is same but my example is for category.

Converting JSON txt file to XML

We're constructing a network of data and part of that includes modifying a search query from a public website to pull all of the data we want. That data, however, when pulled is stored into a JSON txt file.
Ultimately we want this data to be stored in an Access Database so the next step, we thought, was to convert it to XML so we can have an Excel sheet to import. We found a formatting tool (http:jsonformatter.org). When running the tool we received the following error:
“Microsoft Access has encountered an error processing the XML schema in file ‘Data.xml’,
A document must contain exactly one root element”
I've no idea what this entails or where to start debugging. Are there alternatives we might consider?
The error says that there is more than one root element. Have you validated the XML generated? I looked at the website. I tried to ask via comment but I don't have enough rep but you should post some of your json and xml.
If I am reading your issue correctly, you are converting json to xml format and then to excel?
I would suggest writing some code to consume the json and export the xml files to import.

how to retrieve the data from xml and display it in table in html

I wanted to develop a small search website where I will be storing the data in XML files. When we search anything, it should display those data as table format in html. How does one retrieve the data from XML files?
Below is the basic thing to display data of only two columns, but I want to display data dynamically:
html file:http://www.w3schools.com/xml/xml_applications.asp
This is the sample code for retrieving the data from xml only for two columns.
Well the first problem I see is that you have two functions in there that are not being called. Nothing programmatic will happen in this scenario. When you have a method you need to call said method with myFunction(). I would recommend reading up a little more on javascript instead of copying and pasting it and expecting it to just "work"
To further elaborate, you removed the function call from the example you took when you took off the button. What is your xml endpoint? (it's not going to be the same as the example unless you build it to be that way). In this example it's just an xml file that is hosted on the server with the same root as the html.

Puppet - CSV file header

I'm, writing a Puppet (3.6.2) module that reads data fields from a CSV file via the extlookup function and I cannot figure out how to tell extlookup that the first line is the header field. Does extlookup support this? If not, can anyone recommend an external function I could import and use?
thanks,
PS - Yes I know about hiera, and having the data in YAML or JSON files but my requirement is CSV files only.
Brandon
The behavior of extlookup() is pretty well documented. It makes no special provision for column headers, which are by no means an inherent feature of CSV format. Indeed, if your header line is not readable as a data line, then your file is not CSV at all.
Supposing that your file is indeed valid CSV, the absolute simplest solution would be to ignore the issue. It presents a problem only if the first column heading duplicates an actual or potential data name. If it does not, then you will never look up or use the psuedo-value represented by the first row.
If your file in fact is not CSV on account of its first line, or if the first column name conflicts with a real data name, then it seems the next best alternative would be to just remove that line, or to avoid creating it in the first place. I don't see any reason why one of these should not be possible.
I know about heira, and having the data in YAML or JSON files but my requirement is CSV files only.
How sad. Do be aware that extlookup() has long been deprecated, and it was removed from Puppet 4.
I'm inclined to suggest you implement a translator from CSV to Hiera-friendly YAML, and use Hiera in your module. Alternatively, Hiera supports custom backends, and it's not too hard to write one. I am unaware of an existing CSV backend for Hiera, but you could write one. Ignoring a header line would then be under your control, and you would simultaneously achieve a measure of future-proofing.

Parse HTML-Tables to Access Database

I am looking for a solution to import(parse) HTML-Tables directly into my Accessdatabase. When I am using the Do.Cmd- Import HTML Command... I get a whole new Table written into my DB that mirrors the content of the the HTML-Table, I am looking for a direct import solution.
Is there any Option to parse HTML-Tables into an Access-Database like the Import for an Exceltable?
Probably not exactly what you are looking for but Microsoft has a driver you can use for this. I don't see a lot of documentation or examples on it but it appears to be similar to the ODBC text driver.
Go here and scroll do to the part that says "Linking HTML Tables":
http://msdn.microsoft.com/en-us/library/aa164914%28v=office.10%29.aspx
After you have the link setup, if the table and the data all looks correct you should be able to use most any normal Access method to copy the records including copy/paste and VBA DAO loops (the latter being more code intense).