Re: Interbase Null Fields

From: Date: Wed, 08 May 2002 14:04:01 +0000
Subject: Re: Interbase Null Fields
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19042@lists.php.net to get a copy of this message
On Wednesday 08 May 2002 14:02, Benj wrote: > I have a field in a IB table that have a field that is null in some cases. > If I check for the value of that field via the record set wich I obtained > with function > $register=ibase_fetch_object(...); > when i do: > $register->FIELD1 > If FIELD1 is Null for the actual register i get the next warning: > Warning: Undefined property: FIELD1 in C:\path\file.php on line XX > > Is there any way to check a field that some times contain null values > without getting this warning message? > > Thx > --------------------------------------- > Benjamí Tauler > "Everyone should carefully observe which way his heart draws him, and then > choose that way with all his strength." > - Hasidic Saying You can use get_object_vars() for this. It returns an associative array of an object's variables. $register_vars = get_object_vars($register); if (isset($register_vars['FIELD1'])) { ... this means the property is defined ... } http://php.net/get_object_vars for more info -- Meir Kriheli

« previous php.db (#19042) next »