Lists: | pgsql-php |
---|
From: | Zouari Fourat <fourat(at)gmail(dot)com> |
---|---|
To: | pgsql-php(at)postgresql(dot)org |
Subject: | From MySQL to PostgreSQL |
Date: | 2005-02-22 11:07:39 |
Message-ID: | 621eda8a05022203075252d65@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-php |
Am just migrating from mysql db to pgsql db, an want to ask about some
clarifications on the php pgsql api :
*> is pg_fetch_all faster than iterating with pg_fetch_assoc ?
*> how to avoid sql injections, should i use the same methods with
mysql ? (addslashes)
From: | Mariusz Pękala <skoot(at)qi(dot)pl> |
---|---|
To: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: From MySQL to PostgreSQL |
Date: | 2005-02-22 11:48:16 |
Message-ID: | 20050222114816.GB18450@lisa.tutaj |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-php |
On 2005-02-22 12:07:39 +0100 (Tue, Feb), Zouari Fourat wrote:
> Am just migrating from mysql db to pgsql db, an want to ask about some
> clarifications on the php pgsql api :
>
> *> is pg_fetch_all faster than iterating with pg_fetch_assoc ?
You should test. :-)
I believe (I should test too) that it is faster, but with _large_ data sets
you will use a lot of memory, so things will slow down or break.
For known small results (SELECT ... LIMIT ..) why not.
> *> how to avoid sql injections, should i use the same methods with
> mysql ? (addslashes)
No, you should use pg_escape_string()