Chapter 2: Creating and Using a Web Service

In This Chapter

arrow.png Understanding web services

arrow.png Sharing data with web services

arrow.png Receiving web service data

If you’ve read Book V, you’re already familiar with how to get data from a MySQL database. To do so, you connect to the database, execute a query to get some data, and then do something with the results.

Databases work great for most everything that you’ll build with your own site. But there are times when you need to access information outside of your own database. In these instances, you might be able to use (or consume) a web service offered by another company. For example, Twitter offers web services that enable you to retrieve tweets and other information, Amazon offers various web services, and several other companies offer public web services into their data.

This chapter looks at how to create and consume web services. We start with a simple web service that returns the current date and then move into creating other web services that accept input.

Understanding Web Services

When you grow your web site, you might find that you want to create web services of your own, and then offer those to external sites or have for your own use. ...

Get PHP, MySQL, JavaScript & HTML5 All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.