|
From: Ben C. <php...@be...> - 2001-10-30 23:35:08
|
Yup, this is high on my todo list as well, and it gives me an excuse to learn more about pg. You'll notice in the database class in include.php that I added a new function, limit_query(), which does a limit query in the syntax appropriate for the db being used. Of course it is currently limited to the two types, but that's all we are advertising. :) I think I got all the queries that used mysql's limit syntax and changed them to use $q->limit_query().
I was planning on handling the concat problem similarly. I'm taking my cues from the adodb code, as it has a concat handler for the various syntaxes. In fact, I've been thinking about moving away from phplib for db and templates and going to adodb and smarty, respectively. Any thoughts on that?
On Tue, Oct 30, 2001 at 07:43:49PM +0100, Javier Sixto wrote:
> I was working on support request for postgresql :-)
>
> I have solve the basic error from template extends, i have just change
> conditional synatx (IF is not compatible whith pgsql, but CASE works
> with both)
> There is many bugs like this ... when we use some specific Mysql
> function ..like CONCAT ... or LIMIT ... this cause a lot of errors on
> pgsql ...
> It is not a simple thing to make compatible SQL queries between
> differents DB types ...
>
> Mysql : CONCAT('str1','str2') > Pgsql 'str1' || 'str2'
>
> Mysql :
>
> This example will limit the result to 10 rows, starting with row 5.
> SELECT name FROM customers LIMIT 5 , 10
>
> Pgsql :
>
> This example will limit the result to 5 rows, starting with row 10.
> SELECT name FROM customers LIMIT 5 , 10
>
> This limit problem is a big problem .... There is two solutions :
>
> ->Each Query can be simplified
>
> OR
>
> ->Code must use different queries in funtion of DB type
>
> Any other ideas are welcome !
>
>
> Funny Game :-P
>
>
>
>
>
>
>
>
> _______________________________________________
> phpbt-dev mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/phpbt-dev
|