Re: PHP and PostgreSQL
| From: | (Philip Hallstrom) | Date: | Wed, 05 Jul 2000 16:03:07 +0000 |
| Subject: | Re: PHP and PostgreSQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4998@lists.php.net to get a copy of this message | ||
I could be wrong about this, but isn't the default for CHAR/VARCHAR/TEXT
''? I mean... if you don't specify a value it defaults to ''.. what if
you change your table to be:
...
review text default NULL,
....
???
In article <am.php.general.962736220.48327@illiad.adhesivemedia.com>,
Corey Mosher <corey@hub.org> wrote:
>the table looks like this:
>
>mid serial,
>title text,
>year text,
>review text
>
>the query looks like this:
>$query = "INSERT INTO movie (title, year) VALUES ('$title',
>'$year')";
>
>This should put a null value in review, however, it puts a string of
>spaces. eg.
>
>movie=> select '[' || review || ']' from movie where oid = <the oid
>num>;
>?column?
>----------
>[ ]
>(1 row)
>
>corey
>
>On Tue, 4 Jul 2000, Joe Conway wrote:
>
>> >Hi,
>> > I am trying to do an insert into my postgreSQL database
>> >from a form. When I try to insert a null value, it gets
>> >put into the database as a string of spaces. Any ideas as to
>> >why and how to insert the correct null value?
>> >
>> >Corey Mosher
>>
>>
>> What does your table look like? What does your insert string look like? It sounds
>like you may be inserting '' instead of null into a char field.
>>
>> Joe
>>
>>
>
>Corey Mosher
>Hub.Org Networking Services
>Wolfville, NS
>Canada
>corey@hub.org
>
>
>
>--