X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 01B688B9B19 for ; Tue, 22 Feb 2005 11:48:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27855-05 for ; Tue, 22 Feb 2005 11:48:18 +0000 (GMT) Received: from 80.55.160.128 (ve128.internetdsl.tpnet.pl [80.55.160.128]) by svr1.postgresql.org (Postfix) with ESMTP id 5116C8B9E6E for ; Tue, 22 Feb 2005 11:48:18 +0000 (GMT) Received: (qmail 18656 invoked by uid 1000); 22 Feb 2005 12:48:16 +0100 Date: Tue, 22 Feb 2005 12:48:16 +0100 From: Mariusz =?iso-8859-2?Q?P=EAkala?= To: pgsql-php@postgresql.org Subject: Re: From MySQL to PostgreSQL Message-ID: <20050222114816.GB18450@lisa.tutaj> References: <621eda8a05022203075252d65@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VywGB/WGlW4DM4P8" Content-Disposition: inline In-Reply-To: <621eda8a05022203075252d65@mail.gmail.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.581 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, RCVD_NUMERIC_HELO X-Spam-Level: * X-Archive-Number: 200502/18 X-Sequence-Number: 2992 --VywGB/WGlW4DM4P8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 : >=20 > *> 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() --VywGB/WGlW4DM4P8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFCGxwAlA+/TuXKaj0RAv/JAJ4hftR3bcm2rrHawoIRbP7dkPZrLQCgqLLt /5Zt8dfYAPPLDR8ShhnPzEA= =cI6R -----END PGP SIGNATURE----- --VywGB/WGlW4DM4P8--