Re: Checking for NULL value in Database

From: Date: Tue, 18 Jun 2002 19:58:51 +0000
Subject: Re: Checking for NULL value in Database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-102776@lists.php.net to get a copy of this message
On Mon, Jun 17, 2002 at 10:46:27AM -0400, Andre Dubuc wrote: > I'm tryiing to append entries in a db textarea field 'rbook'. Everything > works fine IF there is an existing entry. However, if no entries exist, it > nothing is written to the db. (PostgreSQL 7.2) I'm not familliar with PostgreSQL, but it sure looks like your problem stems from your using UPDATE queries. If a record doesn't exist, there's no record to update. You need to use INSERT queries in that case. Also, you only need one pg_connect() statement. While that's not your problem, it's a waste to have them in there. Just keep the one at the top. Ditch the ones inside your if/else structure. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

« previous php.general (#102776) next »