Received: from mail.siol.net (odin.siol.net [193.189.160.10]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f05MGD741466 for ; Fri, 5 Jan 2001 17:16:13 -0500 (EST) (envelope-from uros@sir-mag.com) Received: from neli ([193.189.182.207]) by mail.siol.net (InterMail vK.4.02.00.10 201-232-116-110 license 3b7ff800a4377eede9efc7be81e8a7c4) with ESMTP id <20010105221631.DNNG20016.mail@neli> for ; Fri, 5 Jan 2001 23:16:31 +0100 Date: Fri, 5 Jan 2001 23:17:29 +0100 From: Uro Gruber X-Mailer: The Bat! (v1.44) Reply-To: Uro Gruber Organization: SIR X-Priority: 3 (Normal) Message-ID: <631076786.20010105231729@sir-mag.com> To: pgsql-general@postgresql.org Subject: PHP and PostgreSQL Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1250 Content-Transfer-Encoding: 8bit X-Archive-Number: 200101/209 X-Sequence-Number: 2378 Hi! I have some questions about coding in php with postgre. Here is my code $qu = pg_exec ($db_conn, "SELECT * FROM clients ORDER BY username"); $row = 0; // postgres needs a row counter other dbs might not while ($data = @pg_fetch_object ($qu, $row)) { echo $data->username." ("; echo $data->password ."): "; echo $data->client_id."
"; $row++; } When i execute this i get 3 records (in DB is also 3 records), if i delete @ before pg_fetch_object i get an error: "Unable to jump to row 3 on PostgreSQL result index 4" I understand what's wrong and i know why is that @. What i do want to know is, if there is something wrong with this function or am i doing something wrong. I don't like that kind of errors. How can i stop before the end. In mysql there was no need to count rows. Thanks -- Uros