Question: There exists an RSS feed with over 1000 items. I want to create a Yahoo Pipes RSS feed that returns a subset of the feed's items, specified by the index of the first and last item. For example, I could pass in first=500 and last=600, and the Pipe will return an RSS feed with only the 500th through 600th itemd in the source feed. Is this possible with Yahoo Pipes, and if so can someone point me in the right direction?

Answer: 
Try this:

```
$query  = "SELECT id, title, content, contactname, contactemail, contactnumber ".
         "FROM vacancies ".
         "WHERE id = '".$_GET['id']."'";

```

I always try to leave the variables out of my strings, just add them in with periods, I find it eliminates a lot of confusion.
One problem:

```
   $query = "UPDATE vacancies
            SET title = '$title', content = '$content', contactname = '$contactname', contactemail = '$contactemail', contactnumber = '$contactnumber'".
        "WHERE id = '$id'";

```

results in no space between the last column and the WHERE clause. Change it to:

```
   $query = "UPDATE vacancies
            SET title = '$title', content = '$content', contactname = '$contactname', contactemail = '$contactemail', contactnumber = '$contactnumber' ".
        "WHERE id = '$id'";

```

or my preferred format:

```
$query = <<<END
UPDATE vacancies
SET title = '$title',
    content = '$content',
    contactname = '$contactname',
    contactemail = '$contactemail',
    contactnumber = '$contactnumber'
WHERE id = '$id'
END;

```

**Note:** You should really escape the fields using mysql\_real\_escape\_string().