RETS Retrieval with PHP and VieleRETS: Part 3
By trent on 06 Feb in PHP
Now we’re back out at the main menu where we can create, edit rename our Sources, Targets and Extracts. The next thing we need to do is create a Target(a local storage location). For this example we will set up a database(mysql to be specific, but any database should work equally as well). Before you proceed there is one thing you should do first.
Create Your Database Tables
Open up your database administrator(phpmyadmin, pgAdmin, etc..) and we will create two tables. One for our listings and one for the image names.
- listings table: Create a table “mls_listings” (you can call it whatever you wish). By default vieleRETS goes with exactly 24 fields, all varchar(255), named c1,c2,c3,…c23,c24 accordingly, but its been reported to work with any column names, so you may want to make them more descriptive.
- Images table: Create a table “mls_listings_images”. Same as before VieleRETS goes with 6 fields, all varchar(255), named c1,c2,c3,c4,c5,c6, but you may want to be a bit more descriptive.
Create Your Target
Now we’re ready to create the target within VieleRETS. Go ahead and choose the create option for Target.
- Step one is to create a Name for this Target. If you will have only one target Default should be fine. For Type choose Relational Database. Click Apply.
- Step two is the username, password routine. Enter these credintials and accept the defaults for all the others. Be sure Auto_Create is set to false. If it is set to true vieleRETS will recreate the tables every time you update. This is fine if you only have one Source going into this Target, but when there are multiple Sources going into the same table we do not want to drop the tables!
- The next step asks for your tables to add the listings to. Choose the tables we created earlier accordingly. Click Apply.
- Step four asks for the table columns of the listings table, make sure all are checked and click Apply.
- Step five asks for the table columns for the images table, make sure all are checked and click Apply.
- Step six asks for the image table key. Choose c1. Click Apply.
- Step seven asks where to save the images. This is completely up to you. But save them somewhere to be accessible by your web address ( www.mysite.com/mlsimages/ ) Click Apply.
We’re done with creating the Target! In the next step we will create an Extract to send all of our Sources to this Target.
- RETS Retrieval with PHP and VieleRETS: Part 1, Introduction
- RETS Retrieval with PHP and VieleRETS: Part 2, Creating a Source
- RETS Retrieval with PHP and VieleRETS: Part 3, Creating a Target
- RETS Retrieval with PHP and VieleRETS: Part 4, Creating a Source
- RETS Retrieval with PHP and VieleRETS: Part 5, Executing the Batch
- RETS Retrieval with PHP and VieleRETS: Part 6, Creating a Cron Job