Mr. Majestic
Jul 28 2008, 06:29 PM
Can someone tell me how to take the data out of an element from a XML files and insert it into a MYSQL table field. Meaning how could I take this data:
CODE
<name>This is my name</name>
and insert it into MYSQL.
Mr. Majestic
Jul 29 2008, 05:49 AM
Ok, here is the deal. I've figured out the above question, but now I have another one. I have some Gzip files on another server. I would like to have a PHP (or java) file to unzip this file and store the contents in a given directory. Anyone help me do this?
NaRzY
Jul 29 2008, 08:33 AM
Zymic doesn't yet have the feature to uncompress via the ZHCP. You must do it on your local machine then upload.
Jacob.
Mr. Majestic
Jul 29 2008, 05:41 PM
QUOTE(NaRzY @ Jul 29 2008, 08:33 AM)

Zymic doesn't yet have the feature to uncompress via the ZHCP. You must do it on your local machine then upload.
Jacob.
If it makes a difference this site isn't hosted by zymic.
wozzym
Jul 29 2008, 06:37 PM
Mr. Majestic
Jul 29 2008, 10:02 PM
I'm going to give it a try, but I don't think it can do what I want. The site that I am working on is rather complicated. It must download and unzip GZip files from a project server, read the contained XML stats directory into MYSQL and then delete the Gzip file. This all needs to happen automatically at a certain time (which will be made simple with cron jobs if I can just get a php or java file to do this!)
Trippin7464
Jul 30 2008, 06:36 AM
I personally don't know anything about gzip, but after a quick google search i'm pretty sure you need the zlib extension installed on your server (you can do a phpinfo() and check if it is installed and enabled [on my phpinfo i scrolled about 3/4 of the way down and it was there]) and the php manual has a list about it.
http://www.php.net/manual/en/ref.zlib.php
Lop12a
Aug 16 2008, 06:36 PM
Hi Mr. Majestic,
I think you may use the DOM XML object to solve your problem. Please goto this site for more details
http://us2.php.net/domxml
Tim
Aug 19 2008, 01:32 PM
Tbh the best way to extract data from XML files is using SimpleXML, its a function thats normally default in PHP.
to use the class you would use something like
CODE
$xmlArray = SimpleXMLElement("<user><name>My Name</name></user>");
echo $xmlArray->user->name;
this will work with fopen and curl resources too
I hope this helps.
Trippin7464
Aug 19 2008, 10:39 PM
Well considering fopen and curl are both disabled on this server, I don't know if SimpleXML is installed.
Tim
Aug 26 2008, 04:37 PM
Hmm as he never mentioned that hes on zymic servers I never assumed so.
Trippin7464
Aug 27 2008, 04:07 AM
Thats true Tim, I didn't re-read the thread after I posted, He did say "If it makes a difference this site isn't hosted by zymic."
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.