X-Original-To: pgsql-php@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 44AAF475AFA for ; Sun, 23 Feb 2003 14:15:58 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 01546-02 for ; Sun, 23 Feb 2003 14:15:47 -0500 (EST) Received: from snickers.hotpop.com (snickers.hotpop.com [204.57.55.49]) by postgresql.org (Postfix) with ESMTP id 263DB4758FE for ; Sun, 23 Feb 2003 14:06:35 -0500 (EST) Received: from hotpop.com (kubrick.hotpop.com [204.57.55.16]) by snickers.hotpop.com (Postfix) with SMTP id 2313171C0B for ; Sun, 23 Feb 2003 19:06:30 +0000 (UTC) Received: from societykotla (unknown [61.0.95.114]) by smtp-2.hotpop.com (Postfix) with ESMTP id 37EAD1B8673 for ; Sun, 23 Feb 2003 19:06:06 +0000 (UTC) Message-ID: <000b01c2db6f$2bf0a840$c9c832c0@societykotla> From: "Aspire Something" To: "pgsql-php" Subject: Re: updating integer column Date: Mon, 24 Feb 2003 00:39:29 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0008_01C2DB9D.30E1D490" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/48 X-Sequence-Number: 1899 This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C2DB9D.30E1D490 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, You can get aroung this type of problem by identifing the filed type and th= en add an default value of the field when the record is null=20 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 th= e data //DATA is the array of the data you retrived from your form //DEFAULT_VALUE this is the array of the default values=20=20 NOW loop thru the DATA array and when an null value is found replace it with the deafult value=20 TIP : You may use=20 1 for loop 2. For each loop } If you want an working example revert back . Regards Aspire420 ------=_NextPart_000_0008_01C2DB9D.30E1D490 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
You can get aroung this type of problem by= =20 identifing the filed type and then add an default value of the field when t= he=20 record is null
provided by PHP .
 
Make an function to do this .
 
As.
1.=20 function(DATA_TYPE,PG_FIELD,DATA,DEFAULT_VALUE)
 
    {
// DATA_TYPE is an array that  contai= ns the=20 datatype of the PG_FIELD
//PG_FILED is the array of column nam= e in=20 which you would like to insert the  data
//DATA is the array of the data you retriv= ed from=20 your form
//DEFAULT_VALUE this is the array of the d= efault=20 values  
 
NOW loop thru the DATA array and  whe= n an null=20 value is found
replace it with the deafult value <= /DIV>
 
TIP :
You may use
1 for loop
2. For each loop
}
 
If you want an working example revert back= =20 .
Regards
Aspire420
------=_NextPart_000_0008_01C2DB9D.30E1D490--