From: Aspire Something <aspire420@hotpop.com>
To: pgsql-php <pgsql-php@postgresql.org>
Subject: Re: updating integer column
Date: Mon, 24 Feb 2003 00:39:29 +0530
Message-ID: <000b01c2db6f$2bf0a840$c9c832c0@societykotla> (raw)
Hi,
You can get aroung this type of problem by identifing the filed type and then add an default value of the field when the record is null
provided by PHP .
Make an function to do this .
As.
1. function(DATA_TYPE,PG_FIELD,DATA,DEFAULT_VALUE)
{
// DATA_TYPE is an array that contains the datatype of the PG_FIELD
//PG_FILED is the array of column name in which you would like to insert the data
//DATA is the array of the data you retrived from your form
//DEFAULT_VALUE this is the array of the default values
NOW loop thru the DATA array and when an null value is found
replace it with the deafult value
TIP :
You may use
1 for loop
2. For each loop
}
If you want an working example revert back .
Regards
Aspire420
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: aspire420@hotpop.com
Subject: Re: updating integer column
In-Reply-To: <000b01c2db6f$2bf0a840$c9c832c0@societykotla>
References: <000b01c2db6f$2bf0a840$c9c832c0@societykotla>
* 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