Link to home
Create AccountLog in
Avatar of namsu55
namsu55Flag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP Web Service with MYSQL

I can use DOM fine in PHP to manipulate XML and display it properly. My question is how could I implement this web service that could take in search from the form and collect the data from the mysql, transform it into an XML file and maintaining some sort of pagination.
Avatar of namsu55
namsu55
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Note I already have search implementation from MYSQL and pagination how ever I am interested in web service.
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of namsu55

ASKER

Just trying to learn web services. I want to make a php web service where I can produce an xml file from mysql result, and then maybe try in future to merge results from another similar service together, based on the same XML. The reason why I talk about pagination is because we use it with all searches and im not sure how I would use MYSQL and XML to do this. Would I have to put all search results in XML or like the 10 links per page limit put 10 links into XML and then use that.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Pagination is usually used in the HTML output from a query - for example, if a query is giving you hundreds of rows in the results set, you would break up the output to create smaller web pages.

I have nothing against SOAP, but I am a bigger fan of RESTful interfaces.  In the REST model, you give all the signals in the URL query string and the web service returns the responses has a string, probably CSV or XML.  A good example is the Yahoo API discussed here:

http://developer.yahoo.com/maps/rest/V1/geocode.html

The advantage of the REST approach is that you do not have to know anything about how the web service works.  This makes the calling sequence much simpler.

Best regards, ~Ray