Skip site navigation (1) Skip section navigation (2)

Re: select * from table not showing everything

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Richard Dunne <richarddunne1971(at)yahoo(dot)com>
Cc: Lista PG-PHP <pgsql-php(at)postgresql(dot)org>
Subject: Re: select * from table not showing everything
Date: 2007-04-28 14:50:38
Message-ID: D089E2FF-1A68-4166-895B-AB4C738C7AB8@pgedit.com (view raw or flat)
Thread:
Lists: pgsql-php
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


In response to

pgsql-php by date

Next:From: Richard DunneDate: 2007-04-28 20:45:11
Subject: Fw: select * from table not showing everything
Previous:From: Richard DunneDate: 2007-04-28 14:09:14
Subject: select * from table not showing everything

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group