From richarddunne1971@yahoo.com Sat Apr 28 14:09:19 2007 Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id C02199FB402 for ; Sat, 28 Apr 2007 11:09:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 99499-06 for ; Sat, 28 Apr 2007 11:09:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web50303.mail.re2.yahoo.com (web50303.mail.re2.yahoo.com [206.190.38.57]) by postgresql.org (Postfix) with SMTP id C4B399FB1F3 for ; Sat, 28 Apr 2007 11:09:15 -0300 (ADT) Received: (qmail 77548 invoked by uid 60001); 28 Apr 2007 14:09:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=Kl0FZet+5K6Yt1HNpiPmt9RpvlrLUk351sIKHvdbSG4q/i6Z2ohMLVdiVobDR5gyaL1VGB2Gw8Prxi04/aZSRyNvAHsqlqXxuJt2XcXVpt2309IIpUx6elaTysqZPoQjm9Dw7RtCXoAFOxoNbptui2ziGEIU3Qwxs9bSyAoYMm8=; X-YMail-OSG: WdPVELEVM1kxU8lklKGeQagkUh7M6T_luYME8LpjB9Qy_wGKNo_pa2CbkjYaeuCKgQ-- Received: from [85.134.146.181] by web50303.mail.re2.yahoo.com via HTTP; Sat, 28 Apr 2007 07:09:14 PDT X-Mailer: YahooMailRC/478 YahooMailWebService/0.7.41.10 Date: Sat, 28 Apr 2007 07:09:14 -0700 (PDT) From: Richard Dunne Subject: select * from table not showing everything To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Message-ID: <99437.76872.qm@web50303.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.435 tagged_above=0 required=5 tests=AWL=-2.735, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447 X-Spam-Level: X-Archive-Number: 200704/9 X-Sequence-Number: 3786 I am using a php script via an xmlhttprequest to insert data into a postgresql table from a php web page form. before submitting the form data, I had 1 entry in my table. after submitting the form data, I ran a select * from table query which declared there were 2 entries in the table, but it only displayed the original entry. Is this a know issue? If this is not the corect forum for this post, please advise. This is the code. php web page ALLIED AUTO PARTS

Choose from the following funtions

View Parts Purchases Sales Add parts Update Customer Update Supplier
php script for inserting form data __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From desoi@pgedit.com Sat Apr 28 14:50:47 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CE1109FB34E for ; Sat, 28 Apr 2007 11:50:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 08329-03 for ; Sat, 28 Apr 2007 11:50:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from a2s5.a2hosting.com (a2s5.a2hosting.com [209.124.50.10]) by postgresql.org (Postfix) with ESMTP id C2E919FB322 for ; Sat, 28 Apr 2007 11:50:44 -0300 (ADT) Received: from adsl-153-114-69.tys.bellsouth.net ([70.153.114.69] helo=[192.168.1.12]) by a2s5.a2hosting.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1HhoG2-0007Gb-MA; Sat, 28 Apr 2007 10:50:42 -0400 In-Reply-To: <99437.76872.qm@web50303.mail.re2.yahoo.com> References: <99437.76872.qm@web50303.mail.re2.yahoo.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Lista PG-PHP Content-Transfer-Encoding: 7bit From: John DeSoi Subject: Re: select * from table not showing everything Date: Sat, 28 Apr 2007 10:50:38 -0400 To: Richard Dunne X-Mailer: Apple Mail (2.752.3) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a2s5.a2hosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pgedit.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/10 X-Sequence-Number: 3787 On Apr 28, 2007, at 10:09 AM, Richard Dunne wrote: > $result=pg_query($connect, "insert into customer values > ('$customer_name', '$customer_address', '$customer_contact_no')"); Are these really the first columns in the customer table? If not, you need to specify the target columns in the insert, e.g. insert into customer (customer_name, customer_address, customer_contact_no) values ('$customer_name', '$customer_address', '$customer_contact_no') Even if these are the first columns, it is not a good idea to leave the column specs out since your code will break if you change the table in an incompatible way. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL From richarddunne1971@yahoo.com Sat Apr 28 20:45:21 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8A0E69FB3BC for ; Sat, 28 Apr 2007 17:45:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 61069-02 for ; Sat, 28 Apr 2007 17:44:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web50311.mail.re2.yahoo.com (web50311.mail.re2.yahoo.com [206.190.39.202]) by postgresql.org (Postfix) with SMTP id 6E6A39FB4B9 for ; Sat, 28 Apr 2007 17:45:13 -0300 (ADT) Received: (qmail 36146 invoked by uid 60001); 28 Apr 2007 20:45:12 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=KmMHxlHeppHVHyjgbarZRJidxGT+ldE0rZMZ+ikO04tpiZh60BaTa0BVlaGchSJW2Imy0bUPa7yWEpGabo7io1KMyzKzUVqq4VDfqf7t2E6fcg96C3xW/sN/F2WmszTNxSvNzwEPkwADVeqfkmgQ3W1QAoT3LS4NHGveXmeAmjs=; X-YMail-OSG: 6XJYF1QVM1l.a.M76M7h9g7qsTN7CdMnifENzaKuNlI1Gsy8yKUVzGRCQMra3SH5lvGdiWxjZwq9y58GCJI22L68jMKsST7N0gQ5M.GFln7H6IHJEcjjhaVXibpcAA-- Received: from [85.134.146.181] by web50311.mail.re2.yahoo.com via HTTP; Sat, 28 Apr 2007 13:45:12 PDT X-Mailer: YahooMailRC/478 YahooMailWebService/0.7.41.10 Date: Sat, 28 Apr 2007 13:45:11 -0700 (PDT) From: Richard Dunne Subject: Fw: select * from table not showing everything To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Message-ID: <209777.36134.qm@web50311.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.682 tagged_above=0 required=5 tests=AWL=-2.488, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447 X-Spam-Level: X-Archive-Number: 200704/11 X-Sequence-Number: 3788 I am still at a loss. I deleted everything from the table using delete from table; I then added a row using the php method with the php webpage. I then checked the table with select * from table; this being the result name | address | contact_no ------+---------+------------ | | (1 row) As you can see its detecting an entry in the table but it is not displaying the entry. Can anyone advise? I am only geussing at a configuration problem? Richard. ----- Forwarded Message ---- From: Richard Dunne To: pgsql-php@postgresql.org Sent: Saturday, April 28, 2007 3:09:14 PM Subject: select * from table not showing everything I am using a php script via an xmlhttprequest to insert data into a postgresql table from a php web page form. before submitting the form data, I had 1 entry in my table. after submitting the form data, I ran a select * from table query which declared there were 2 entries in the table, but it only displayed the original entry. Is this a know issue? If this is not the corect forum for this post, please advise. This is the code. php web page ALLIED AUTO PARTS

Choose from the following funtions

View Parts Purchases Sales Add parts Update Customer Update Supplier
php script for inserting form data __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From guillaume@lelarge.info Sun Apr 29 07:40:42 2007 Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 92CA19FB395 for ; Sun, 29 Apr 2007 04:40:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85486-05 for ; Sun, 29 Apr 2007 04:40:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sd-2317.dedibox.fr (sd-2317.dedibox.fr [88.191.17.192]) by postgresql.org (Postfix) with ESMTP id 4212A9FB30D for ; Sun, 29 Apr 2007 04:40:39 -0300 (ADT) Received: from sd-2317.dedibox.fr (localhost.localdomain [127.0.0.1]) by sd-2317.dedibox.fr (Postfix) with ESMTP id 1FDC610163; Sun, 29 Apr 2007 09:44:04 +0200 (CEST) Received: from [192.168.10.64] (ASte-Genev-Bois-153-1-98-158.w90-3.abo.wanadoo.fr [90.3.184.158]) by sd-2317.dedibox.fr (Postfix) with ESMTP id D94A71015D; Sun, 29 Apr 2007 09:44:03 +0200 (CEST) Message-ID: <46344BED.4000801@lelarge.info> Date: Sun, 29 Apr 2007 09:40:29 +0200 From: Guillaume Lelarge User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Richard Dunne CC: pgsql-php@postgresql.org Subject: Re: Fw: select * from table not showing everything References: <209777.36134.qm@web50311.mail.re2.yahoo.com> In-Reply-To: <209777.36134.qm@web50311.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/12 X-Sequence-Number: 3789 Richard Dunne a écrit : > I am still at a loss. I deleted everything from the table using > delete from table; > I then added a row using the php method with the php webpage. I then checked the table with > select * from table; > > this being the result > > > name | address | contact_no > ------+---------+------------ > | | > (1 row) > > As you can see its detecting an entry in the table but it is not displaying the entry. > Can anyone advise? I am only geussing at a configuration problem? > Perhaps because empty strings were send. You're not telling us your PHP version. If you have 4.2.0 or later, register_globals is by default disabled and $customer_name, $customer_address and $customer_contact_no won't be registered. You'll need to use $_GET array to get those values. Moreover, you don't escape strings. Maybe you should try this $query = "insert into customer values("; $query .= "'" . pg_escape_string($_GET['customer_name']) . "', "; $query .= "'" . pg_escape_string($_GET['customer_address']) . "', "; $query .= "'" . pg_escape_string($_GET['customer_contact_no']) . "')"; $result = pg_query($connect, $query); and read this http://www.php.net/language.variables.predefined Regards. -- Guillaume.