[kwlug-disc] Continued: OpenSource Me!]
Andrew Kohlsmith (lists)
aklists at mixdown.ca
Mon Dec 22 22:33:59 EST 2008
On December 22, 2008 11:44:17 am john at netdirect.ca wrote:
> Abstraction is pretty easy and I think it can often be done after the fact
> on small projects like this one. All you have to do is stay away from
> non-standard SQL. Incidentally, creating abstraction is a good project to
> let the community do. Let the person who wants this to run on PostgreSQl do
> the work.
I agree with John here; create your SQL queries as an array of strings, and
access SQL *only* through those strings. I know that both PHP and Perl allow
you to have variables within those strings and the SQL functions substitute
in values just before they run. Persistent connections and cached results
also come for free with the generic PHP accessors. Pear is a PHP abstraction
layer and may be something to look at as well.
Just don't hardcode those SQL queries!!
More information about the kwlug-disc_kwlug.org