Pulling content from an external database

What is the best way to pull content from an external (SQL) database? I have a couple of uses for this:

  1. I have obituary data (name, date, page of an obituary in my local paper) and I would like my patrons to be able to enter a name in a form and then display the matching entries.
  2. I want to have an external program generate a file (or database) that is then used as input to javascript to display current content on the website.

I have started playing with JSONP. Is there a better strategy?

Thanks!

Hi Peggy,

Depending on the size of the file you may be able to do this 100% client side. You could create a template that publishes to a JSON/xml file format and uses rx.db.get to pull the data from the external database. You’d probably want to create a content type that contained the parameters for the query (database, sql etc) so that you could edit that to re-configure the database pull. Then in your JavaScript you could reference that file using jQuery.

You should only need JSONP if the file will be hosted on a different host and domain than the main web site.

-n

[QUOTE=Peggy;21224]What is the best way to pull content from an external (SQL) database? I have a couple of uses for this:

  1. I have obituary data (name, date, page of an obituary in my local paper) and I would like my patrons to be able to enter a name in a form and then display the matching entries.
  2. I want to have an external program generate a file (or database) that is then used as input to javascript to display current content on the website.

I have started playing with JSONP. Is there a better strategy?

Thanks![/QUOTE]