Saving to a database using PHP
Updated on Tuesday, 15 January, 2013 - 12:55
Step 1. Make sure you look at the Streaming API section of the PHP code example example. It shows how to call the API.
Step 2. Add your username and API key to the code.
Step 3. Look at the format of an object from the source you want to work with. Identify the fields that you want to save to a database.
Step 4. Create a table in your database. Create columns to represent the data you will store.
Step 5. Execute this on your mysql server to create the sample table structure used in the example.
The PHP code will extract information from the stream and save it into the newly created table.
Here's some sample SQL code to create the table:
