pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Lelarge <guillaume@lelarge.info>
To: Richard Dunne <richarddunne1971@yahoo.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Fw: select * from table not showing everything
Date: Sun, 29 Apr 2007 09:40:29 +0200
Message-ID: <46344BED.4000801@lelarge.info> (raw)
In-Reply-To: <209777.36134.qm@web50311.mail.re2.yahoo.com>
References: <209777.36134.qm@web50311.mail.re2.yahoo.com>

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.
<!-- http://abs.traduc.org/
      http://lfs.traduc.org/
      http://docs.postgresqlfr.org/ -->



view thread (4+ messages)

Message-ID: <46344BED.4000801@lelarge.info>
Permalink:  ../46344BED.4000801@lelarge.info/
Also on:    postgresql.org/message-id/46344BED.4000801@lelarge.info

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: guillaume@lelarge.info, richarddunne1971@yahoo.com
  Subject: Re: Fw: select * from table not showing everything
  In-Reply-To: <46344BED.4000801@lelarge.info>
  References: <209777.36134.qm@web50311.mail.re2.yahoo.com> <46344BED.4000801@lelarge.info>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox