Old 12-02-2008, 20:27   #1 (permalink)
natakuzen
Registered User
 
natakuzen's Avatar
 
Join Date: Mar 2006
Posts: 4
Send a message via AIM to natakuzen Send a message via Yahoo to natakuzen
PHP and API

i'm fairly new to PHP and API but I was wondering how do I grab the data from the XML script, that was generated by the API?

I have this project where I have an API that generates an XML script and I'm supposed to grab that data from the XML script and insert the data as a record in a database using mysql. please help? so confused.
  Reply With Quote
Old 12-02-2008, 21:25   #2 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,373
First, I think it would help you to get a really solid understanding of the terms you're using.

PHP is a programming language, which I assume you know.

*An* API is a published interface provided to allow you to directly communicate with someone else's software system without needing to know the internals of how it works. Generally in web terms they're used to suck data from another source, but this is only one of the many definitions depending on the context. The 'an' is significant because no two APIs are the same. There isn't a set way to use one.

XML is a data definition language that has no purpose other than to describe raw data. It isn't a script in the generally accepted use of the term.

Given that you're "fairly new" to PHP, this is likely to be a challenging project for you at this stage. The task you are describing involves a number of steps, none of which are really at the beginner level. Actually most web-based API programming (e.g. Yahoo API, Google's APIs) tends to be done in Javascript using AJAX (or JSON as a substitute for XML).

The only time I used PHP with a third-party API, I used PHP Curl, and found it extremely flexible and straightforward. The manual page is here: PHP: CURL - Manual - this might be a starting point for you.
  Reply With Quote
Old 12-02-2008, 22:17   #3 (permalink)
haku
shiro
 
haku's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 1,657
It is possible to parse XML with PHP, but I've never done it myself so I can't really give any advise on it. But here is the manual that can tell you what to do:

PHP:XML - Manual
  Reply With Quote
Old 13-02-2008, 20:42   #4 (permalink)
natakuzen
Registered User
 
natakuzen's Avatar
 
Join Date: Mar 2006
Posts: 4
Send a message via AIM to natakuzen Send a message via Yahoo to natakuzen
thank you.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8