Hi,
I am designing an open sourced business managemnet tools suite (see http://sourceforge.net/projects/hermesweb) and am running into a limitation of PHP.
The basic problem is that I want the application to be protable between MySQL and PostgreSQL for a number of reasons. For that matter, the application would then be easily protable to any of a number of other database managers.
The way that PHP manipulates the retrieved record set is fundamentally different in PostgreSQL than MySQL. In MySQL, the record appears to come out of a stack, one at a time, and disappearing until all others have disappeared, but in PostgreSQL, they remain in memory and are indexed by their row number. The result is that code which operates quite well on MySQL can create an endless loop on PostgreSQL.
My first attempted solution was to include in the database wrapper functions for PostgreSQL support for global variables which were used as counters, but this does not work where two result sets are being utilized at the same time by the application (endless loop results, because the select statement resets the global counter).
I believe that the problem could be solved using hash tables/associative arrays, but I am not sure how to impliment such a thing (I am familiar with Perl). PHP does not support returning arrays, so a reference to a key would be passed back to the parent application.
Any help would be appreciated. Source code is available but too much to include here.